简体   繁体   中英

GLFW + Visual Studio 2012 - Linking Error

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM