nigels-com / glew

The OpenGL Extension Wrangler Library
Other
2.62k stars 614 forks source link

Glew 2.1.0 Does not build with VS2019 #238

Closed DieSlower closed 4 years ago

DieSlower commented 5 years ago

I've tried to build glew 2.1.0 with VS2019 but I'm getting all kinds of errors. I'm using cmake 3.14.3

When I press configure, cmakes tells me it is done, but when I tell it to generate the cmake project it errors out.

The Errors I'm getting are: Configuring done CMake Error at CMakeLists.txt:169 (add_executable): Cannot find source file:

D:/Development/ExtDev/Build/glew-2.1.0/src/glewinfo.c

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx

CMake Error at CMakeLists.txt:95 (add_library): Cannot find source file:

D:/Development/ExtDev/Build/glew-2.1.0/include/GL/wglew.h

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx

CMake Error at CMakeLists.txt:179 (add_executable): Cannot find source file:

D:/Development/ExtDev/Build/glew-2.1.0/build/visualinfo.rc

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx

CMake Error at CMakeLists.txt:169 (add_executable): No SOURCES given to target: glewinfo

CMake Error at CMakeLists.txt:95 (add_library): No SOURCES given to target: glew

CMake Error at CMakeLists.txt:99 (add_library): No SOURCES given to target: glew_s

CMake Error at CMakeLists.txt:179 (add_executable): No SOURCES given to target: visualinfo

nigels-com commented 5 years ago

Try: https://github.com/Perlmint/glew-cmake

DieSlower commented 5 years ago

Hi Nigel, That repo does not have a 2.1.0 tag. Is there a stable release of the 2.1.0 that works with VS2019?

nigels-com commented 4 years ago

Does GLEW 2.1.0 release zip build with VS2019? I would be surprised if it didn't. https://sourceforge.net/projects/glew/files/glew/2.1.0/

DieSlower commented 4 years ago

@nigels-com sorry for taking some time to reply, I just got back to this... When I build from https://sourceforge.net/projects/glew/files/glew/2.1.0/ with vs2019 i get the following error:

Creating library D:/Development/ExtDev/Build/glew-2.1.0/build/cmake/build/lib/Release/glew32.lib and object D:/Development/ExtDev/Build/glew-2.1.0/build/cmake/build/lib/Release/glew32.exp glew.obj : error LNK2019: unresolved external symbol memset referenced in function glewContextInit D:\Development\ExtDev\Build\glew-2.1.0\build\cmake\build\bin\Release\glew32.dll : fatal error LNK1120: 1 unresolved externals

I have the latest vs2019 and I build with x64 on Win10

DieSlower commented 4 years ago

Just FYI, this is the one that worked for me... https://github.com/Perlmint/glew-cmake/tree/glew-cmake-2.1.0 I don't know what is different about it...it does seem to have a multi context and single context dll?

nigels-com commented 4 years ago

There is a new snapshot available. Builds for me, for you? https://sourceforge.net/projects/glew/files/glew/snapshots/glew-20190928.tgz/download

DieSlower commented 4 years ago

@nigels-com Yes, that snapshot builds great with VS2019! I noticed that the snapshot is version 2.2.0 ...when will that be officially released?

matham commented 4 years ago

I am trying to build the snapshot using 2019 from Github actions and it's erroring out with error LNK2019: unresolved external symbol memset referenced in function glewContextInit.

I'm using the snapshot. And the code is basically:

call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
devenv /upgrade .\\build\\vc12\\glew.sln
msbuild .\\build\\vc12\\glew.sln /property:Configuration=Release /property:Platform=x64

The error is:

glew.obj : error LNK2019: unresolved external symbol memset referenced in function glewContextInit [D:\a\kivy-sdk-packager\kivy-sdk-packager\kivy_build\glew\glew-2.2.0\build\vc12\glew_shared.vcxproj]

..\..\bin\Release\x64\glew32.dll : fatal error LNK1120: 1 unresolved externals [D:\a\kivy-sdk-packager\kivy-sdk-packager\kivy_build\glew\glew-2.2.0\build\vc12\glew_shared.vcxproj]

Done Building Project "D:\a\kivy-sdk-packager\kivy-sdk-packager\kivy_build\glew\glew-2.2.0\build\vc12\glew_shared.vcxproj" (default targets) -- FAILED.

The full build details is here.

I'm hesitant to use https://github.com/Perlmint/glew-cmake because I'm not sure exactly how it relates to this repo?

nigels-com commented 4 years ago

@matham Could you try the vc15 projects, rather than vc12?

matham commented 4 years ago

Could you try the vc15 projects, rather than vc12?

Yes, that indeed seems to work. I thought I looked into the folder and didn't see vc15 there before 🤦

MaximeB5 commented 4 years ago

Being given the issue is still open (got myself the problem with VS2019), I'd suggest you guys use VS2017 instead which is working fine

DieSlower commented 4 years ago

@MaximeB5 I should have closed the issue, from what I remember, it was resolved....