简体   繁体   中英

GLFW not working in Visual Studio Community

I am using Visual Studio for C++. I have tried to link GLFW in Visual Studio. The steps I went through are as follows:

  1. Specify include directories under VC++ properties.
  2. Specify the library directories under VC++ properties.
  3. Add the .lib file in additional dependencies under Linker -> Input

Visual Studio recognises the header #include <GLFW/glfw3.h> and recognised glfwInit() but when glfwInit() is called it causes the build to fail. I get this build error:

LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

I then also get some unresolved externals:

LNK2019 unresolved external symbol __imp__vsnprintf referenced in function __glfwInputError
LNK2001 unresolved external symbol __imp__vsnprintf
LNK2019 unresolved external symbol __imp__sscanf referenced in function _parseVersionString
LNK2001 unresolved external symbol __imp___vsnprintf
LNK1120 3 unresolved externals

Sneaky... when I downloaded GLFW it had multiple lib folders (for the different releases) and only one include folder. I assumed that the include folder would work for all of the lib folders because there was only one. However that was not the case, the include folder only worked for the latest lib folder and I tried to use the 2013 GLFW instead of the latest 2015 GLFW lib folder with the include folder to no avail. I was using 2013 GLFW because that was the version the tutorial series I was watching used if you were wondering.

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