How do I include library files? (not header files)

Started by
1 comment, last by Scraniel 22 years, 5 months ago
I know to include a header file, i type #include , but what is the syntax for a library file such as file.lib? Thanks a lot. ~Scraniel~
Advertisement
In MSVC go to Project->Settings->Link and add it to the text box. In a GCC derivative use -llibname.

[Resist Windows XP''s Invasive Production Activation Technology!]
With MSVC, you can use

#pragma comment(lib, "library name")
which will tell the compiler to attempt to link the library. N&V's method is the preferred way, but placing this code inside the header for a library you're writing can be convenient. GLUT uses this technique.

This topic is closed to new replies.

Advertisement