nigels-com / glew

The OpenGL Extension Wrangler Library
Other
2.58k stars 609 forks source link

LNK Errors #353

Closed Avocadobeef closed 2 years ago

Avocadobeef commented 2 years ago

Hi, I am working on QT ( with MSVC2017 64bit Kit) and CMAKE and i am trying to include the glew library into my project. I am new to CMAKE and I feel like I am linking the wrong .lib files or .dll files or missing a step. I tried compiling the glew_shared and glew_static folder in VSC2017 and adding the glew32d.dll and glew32ds.lib to sub folder and linking them to my project, but I am still getting the same error.

Any idea what I could or should be doing differently?

Here the Error Message: Error_Messages

Cheers

nigels-com commented 2 years ago

glew32ds.lib for Debug-mode and glew32s.lib for Release-mode ought to work.

Avocadobeef commented 2 years ago

Well I am in Debug-mode and linked the glew32sd.lib, so I guess the error might be somewhere else. I think I am not correctly including those files with cmake. I am trying with include_directories($"path-to-headers") and target_link_libraries($"path-to-lib-and-dll-files") but that doesn't work.

Cheers, Marco

nigels-com commented 2 years ago

Keep in mind that the other way to use GLEW is to simply compile it in. (In GLEW_STATIC mode)

Avocadobeef commented 2 years ago

What do you mean by compile it in? I tried a new approach, i used CMAKE to build and generate the library (from the CMAKE folder in the code). Built it with MSCV2017 (BUILD ALL and INSTALL). And now i can use the find_package() command to find glew. I thought doing it this might resolve link problems, the error I now have is it doesn't find 'GL/glew.h'.

Avocadobeef commented 2 years ago

I think i managed to make it work, currently no more compile or build errors. Now i just need to make the code run.