Error:
CMake does not link properly with the glew32.lib (DLL), getting errors like (maybe I am missing a preprocessor definition of the OpenGL3test is missing #include "windows.h"?
LINK: command "C:\PROGRA1\MICROS1\2022\COMMUN1\VC\Tools\MSVC\14391.335\bin\Hostx64\x64\link.exe /nologo examples\CMakeFiles\OpenGL3test.dir\OpenGL3test.cxx.obj /out:bin\examples\OpenGL3test.exe /implib:bin\examples\OpenGL3test.lib /pdb:bin\examples\OpenGL3test.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:windows -LIBPATH:D:\code\applications\mrv2\BUILD-Msys-amd64\Release\FLTK-prefix\src\FLTK\build\src..\lib lib\fltk_gl.lib D:\code\lib\glew-2.2.0\lib\glew32.lib opengl32.lib glu32.lib lib\fltk.lib comctl32.lib ws2_32.lib gdiplus.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:bin\examples\OpenGL3test.exe.manifest" failed (exit code 1120) with the following output:
OpenGL3test.cxx.obj : error LNK2019: símbolo externo __glewBindBuffer sin resolver al que se hace referencia en la función "public: virtual void __cdecl SimpleGL3Window::draw(void)" (?draw@SimpleGL3Window@@UEAAXXZ)
Workaround
Linking against the static glew32 (ie. glew32s) works.
However this prefers static builds instead of shared builds which is contrary to the normal behavior.
find_package(GLEW)
seems to solve the issue (at least on Windows) by having different target variables for static or shared builds.
Expected behavior
FLTK should allow a variable to get passed to find the GLEW library.
It should use find_package(GLEW) to find glew as it is more solid.
It should work with either static or shared (DLL) builds.
It should print out the location where GLEW was found.
FLTK Version
Version: 1.4
Downloaded and self-built from: Git
If from Git, branch: master
FLTK Configure / Build Options
See steps to reproduce.
Operating System / Platform:
OS: Windows
OS Version: 11
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/959@github.com>
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.