Take the 2-minute tour ×

I am currently trying to create a little application in Visual C++ with OpenGL. Therefor I got myself glfw and glew for my Visual Studio 2012. I followed a guide I found for each on how to link them to the project, but I get a bunch of errors when trying to compile:

error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_glfwInit" in Funktion ""public: void __thiscall OpenGL::MainLoop(void)" (?MainLoop@OpenGL@@QAEXXZ)". D:\BachelorArbeit\OpenGL_TEST\OpenGL_TEST\OpenGL_TEST\OpenGL.obj    OpenGL_TEST

and 6 more of those (don't think each individual error is really important at this point.

I have the glfw files in the system directories as the guides I had suggested (I read up on here allready that it's bad practice, but I basicly tried it when trying to get this error fixed).

I have added the extra library directory in the Linker-settings as well. Also tried the #pragma solution.

What I currently think is that I might possibly have the files in to many places, or yet not in the right ones with the right connection. I'll admit, I rarely had to work with linking before so I can't claim to have experience with it.

If any additional information are required I'll most gladly add them.

PS: Sorry for the german in the error-code, I use a german Version of Visual Studio.

share|improve this question
You've added the library directory, but it appears you haven't added the libraries themselves. You need to do that too. –  john Sep 18 '13 at 8:56
Well, I followed a guide as I mentioned that said adding the library directory with the libraries inside would allow Visual Studio to find them, I'll try adding them into the Project manually –  m41n88 Sep 18 '13 at 8:58
edit: either that didn't work or I put them in the wrong place(s). Put them just about anywhere I could imagine they could fit and yet the same error. –  m41n88 Sep 18 '13 at 9:05
No you don't add them to the project, you name the libraries in the library settings. IIRC it's on the input tab of the linker settings. I guess the confusion is that linkers link more than just libraries, so the input to a linker is not called 'libraries'. –  john Sep 18 '13 at 9:05
hmm... if that isn't the Additional Library Directories or Additional Dependencies, I don't quite know where. At least I can't seem to find any further options regarding libraries (might of course just have overlooked something) Additional Dependencies is probably what you meant there, it's on the Input tab. –  m41n88 Sep 18 '13 at 9:08

1 Answer 1

Although you rproblem is solved which was caused by the the 32 bit compilation and 64 bit library linkage but just for teh record, after specifying the addtional directory for the library files, you have to specify what library files should be used to link to. either you can use the options box and specify the file name or you can use the solution below

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

As a good practice this should be right after your include statements, if any

share|improve this answer

Your Answer


