Static Libraries Questions & Answers

«
»
This set of Linux / Unix questions and answers focuses on static libraries.

1. In Linux, the static library has the extension of
a) .a
b) .b
c) .c
d) .d
View Answer

Answer: a
Explanation: None.

2. The library contains the
a) pre-compiled object files
b) source files
c) header files
d) none of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement

3. Libraries can be linked with ____ to create executables.
a) other libraries
b) other object files
c) both other libraries and object files
d) none of the mentioned
View Answer

Answer: c
Explanation: None.

4. In Linux, the static libraries can be created by
a) ar command
b) as command
c) ap command
d) aq command
View Answer

Answer: a
Explanation: None.

5. If a program is linked against a static library then
a) machine code of the used function is copied in the executable
b) used function definition is copied into the preprocessd code
c) used function definition is provided at the time of compiling
d) none of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement

6. To use the static library in the program
a) header file must be provided to in the source code
b) path for the library must be specified
c) header file must be provided to in the source code & path for the library must be specified
d) none of the mentioned
View Answer

Answer: c
Explanation: None.

7. Which gcc option is used to specify the library?
a) -c
b) -l
c) -a
d) -o
View Answer

Answer: b
Explanation: None.

8. In linux, the static libraries are mostly installed in
a) /usr/lib
b) /usr/local/lib
c) both /usr/lib and /usr/local/lib
d) none of the mentioned
View Answer

Answer: c
Explanation: None.
advertisement

9. Which one of the following command can list the symbols defined in a library?
a) mn
b) nm
c) nn
d) mm
View Answer

Answer: b
Explanation: None.

10. The archive(ar) utility in linux can
a) create a new static library
b) insert the object files into the static library
c) replace the object files into the static library
d) all of the mentioned
View Answer

Answer: d
Explanation: None.

Sanfoundry Global Education & Learning Series – Linux Administration & Programming.
Here’s the list of Best Reference Books in Linux Commands & Shell Programming.
Here’s the list of Best Reference Books in Linux Kernel, Device-Drivers & System Programming.

advertisement

To practice all questions on Linux Administration & Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on Linux.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn