This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Compiling and Linking Client Programs”.
1. Which option is necessary to compile a C program havin math functions?
Explanation: To compile a program written in the C language, it is compiled by issuing the option ‘-lm’. The examples of some math functions found in ‘math.h’ are floor(), sqrt(), pow(), log().
2. The option for specifying the executable name while compiling with gcc is _____________
Explanation: When a C program is compiled with gcc, the option -o is issued in order to specify the name of the executable that is created after compilation. The default name given is ‘a.out’.
3. Which file can be used to execute multiple compile statements?
Explanation: The Makefile is used to write multiple commands in there. The file is executed by prefixing the command ‘make’ with the command to run the file script containing the statements.
4. Which flag is used to compile client programs that use MySQL header files?
Explanation: The ‘-I’ option is specified when the client programs are compiled that use the MySQL header files. The compiler can easily find these header files when the ‘-I’ option is used.
5. The MySQL clients are linked with _____________
Explanation: MySQL clients should be linked using the ‘-lmysqlclient’ option in the link command. A ‘-L’ option is also need to be specified to tell the linker where to find the library for it.
6. On Unix, linking uses dynamic libraries by default.
Explanation: On Unix, the linking process uses the dynamic libraries by default. In order to link to the static client library instead, its path name should be added to the link command to do the job.
7. What can be used as an alternative to mysqlconfig?
Explanation: The ‘pkg-config’ statement can be used as an alternative to the ‘mysql_config’ statement for obtaining information like compiler flags or to link libraries required to compile some MySQL applications.
8. Which of these has a smaller memory footprint?
d) machine dependent
Explanation: A clearly significant difference between Perl and PHP is that Perl has a bigger memory footprint than PHP. Apache processes are larger with ‘mod_perl’ linked in than with ‘mod_php’.
9. The static C library client in Windows is _____________
Explanation: The code can be linked with either the dynamic or static C client library. On Windows, the static library is named ‘mysqlclient.lib’ and the dynamic library is named ‘libmysql.dll’.
10. Which of the following is used on Solaris?
c) Sun Studio
Explanation: The program ‘gcc’ is generally used on Unix. ‘clang’ is used on ‘OSX’ or ‘FreeBSD’. The ‘Sun Studio’ is used on Solaris. However, ‘gcc’ on Unix is a widely popular choice for client programs.
Sanfoundry Global Education & Learning Series – MySQL Database.
To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.