Adding the Pragma Directives
will tell the linker what additional input files are needed. The link
will link the object files generated by the compiler and link them with the
additional libraries to generate the ultimate module(.exe or .dll files).
This work can also be done
in the properties dialog of the project. You can add the .lib files in the
property below:
Configuration Properties
-> Linker -> Input -> Additional Dependencies.
The input files will be part
of the linker command in the end. Below is a simple sample shows how the input
files are used in the link command:
link /dll a.obj b.lib c.lib
In short Places a comment
record into an object file or executable file.
Syntax:
#pragma comment(
comment-type [,"commentstring"] )
comment-type
1.compiler:Places the name and version number of the compiler in the object file
2. exestr: At link
time this string is placed in the executable file
3.lib:Places a
library-search record in the object file.
4.linker:Places a linker
option in the object file.
5.user:Places a general
comment in the object file
Examples:
#pragma comment( lib, "emapi" ) //lib comment-type
#pragma comment(
compiler ) //compiler comment type
#pragma comment( user,
"Compiled on " __DATE__ " at " __TIME__ ) //user
comment type
For more reference see also:
http://msdn.microsoft.com/en-us/library/7f0aews7.aspx
No comments:
Post a Comment