Public Group

# How to link libraries in VC++ 2005 Express

This topic is 4363 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I just got VC++ 2005 Express Edition because my old compiler (VC++ 6.0 Introductory Edition) puts an annoying message box at the start of every program I compile in it reminding me that I can't redistribute my programs blah blah... Anyway, I'm trying to compile an OpenGL program. I used to go to Project->Settings and click on the links tab, then add opengl32.lib glu32.lib glaux.lib. Well. There's a "project->project_name properties..." button in VC++ 2005 but I can't really find where to link libs in it. So how do I link libs in VC++ 2005 Express? Also I think I vaguely remember there being a keyword for linking libs although I can't remember it (or am I just dreaming that up?). Either one or preferably both would be good. Thanks in advance.

##### Share on other sites
I'm not at my IDE, so this is just approximate Project->Linker->Input

Otherwise, I like to use the macro approach, as it documents itself in the code:
#ifdef WIN32#pragma comment(lib, "libname.lib")#endif

##### Share on other sites
It should be in project settings; under the linker folder there should be an entry called input. From there add your libraries to the additional dependencies line. You can also add the libraries to your project source files like a regular external source file.

##### Share on other sites
Awesome. Thanks yall.

• 10
• 17
• 9
• 14
• 41