0

I'm using VS2010 to write some win32 app. I normally add .lib files to linkage using to project property manager. yet, sometimes, when I just want to test an API function , I don't want to modify my project file , but rather just add a removable line for linking with the required lib

What is the linker keyword for linking with a given .lib file?

1 Answers1

2

You can use #pragma comment command

Example:

#pragma comment (lib, "d3d9.lib")

Another example:

#pragma comment (lib, "yourlibrary.lib")

Just put in hmm.. before int main(){}

http://support.microsoft.com/kb/153901

http://msdn.microsoft.com/en-us/library/7f0aews7%28v=vs.71%29.aspx

If there are problems:

Ignore #pragma comment(lib, ...)?

Unresolved external symbol when linking my library

Community
  • 1
  • 1
trebor
  • 724
  • 5
  • 16