关于#pragma comment解决思路

关于#pragma comment
#pragma   comment(lib, "xxx.lib ")
#pragma   comment(linker, "/defaultlib:xxx.lib ")
有什么区别?

------解决方案--------------------
/DEFAULTLIB 选项将一个 library 添加到 LINK 在解析引用时搜索的库列表。用 /DEFAULTLIB 指定的库在命令行上指定的库之后和 .obj 文件中指定的默认库之前被搜索。

忽略所有默认库 (/NODEFAULTLIB) 选项重写 /DEFAULTLIB:library。如果在两者中指定了相同的 library 名称,忽略库 (/NODEFAULTLIB:library) 选项将重写 /DEFAULTLIB:library。


------解决方案--------------------
就是搜索次序上的不同吧.
------解决方案--------------------
http://msdn2.microsoft.com/en-us/library/7f0aews7(VS.71).aspx
------解决方案--------------------
就是先搜索他.
------解决方案--------------------
#pragma comment(lib, "xxx.lib ")
The following pragma causes the linker to search for the EMAPI.LIB library while linking. The linker searches first in the current working directory and then in the path specified in the LIB environment variable
#pragma comment(linker, "/defaultlib:xxx.lib ")
you can use a macro in any place where you would use a string literal, provided that the macro expands to a string literal. You can also concatenate any combination of string literals and macros that expand to string literals.
------解决方案--------------------
#pragma comment(lib, "xxx.lib ")
优先于
#pragma comment(linker, "/defaultlib:xxx.lib ")