250+ TOP MCQs on Static Libraries and Answers

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

Answer: a
Clarification: None.

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

Answer: a
Clarification: 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

Answer: c
Clarification: None.

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

Answer: a
Clarification: 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

Answer: a
Clarification: 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

Answer: c
Clarification: None.

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

Answer: b
Clarification: 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

Answer: c
Clarification: None.

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

Answer: b
Clarification: 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

Answer: d

Leave a Reply

Your email address will not be published. Required fields are marked *