Question

For a current project I need to use OpenGL in C++, so I went with the usual choice of GLEW+GLFW. I'm currently also following the tutorial here (first one, opening a window).

As of right now, I've got their projects building when I download their .zip, and run them in VC10, however I am unable to create my own projects.

As mentioned before, I'm running VC10, and so far I've got GLEW and GLM all set up, however GLFW is being a pain. I've set it up as usual (configuring the linker, setting C++ project settings, adding the OpenGL32.lib along with the other necessary libraries, etc.), however I'm still getting the following error when building:

1>glfw3.lib(gamma.obj) : error LNK2019: unresolved external symbol __libm_sse2_pow_precise referenced in function _glfwSetGamma

I'm currently trying it with the pre-compiled binaries on 3.0.3, and I get the same results when building from source on 3.0.4 (they apparently discontinued VC10 support starting at 3.0.4).

It is worth noting that I'm running Win7 (64-bit), VC10 (32-bit), and GLFW 3.0.3/3.0.4 (32-bit)

How do I go about fixing this?

Was it helpful?

Solution

Here's how I ultimately fixed my problem:

First I built 3.0.4 from source, using the DLL options, and placed the .lib with the original place. Then I placed the .dll's in the same directory as my .exe that VC10 created (NOT in System32 like most sites recoment). Finally I added glfw3dll.lib to the linker (Properties > Linker > Input > Additional Dep's).

Then in my source I had to cast the GLFW_DLL option via a #define statement (#define GLFW_DLLL)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top