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.

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.
advertisement
advertisement

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.

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.
Note: Join free Sanfoundry classes at Telegram or Youtube

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.
advertisement

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

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

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). 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!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.