configure: link Windows OpenGL libraries and add loader test - #3390
Open
Lestropie wants to merge 4 commits into
Open
configure: link Windows OpenGL libraries and add loader test#3390Lestropie wants to merge 4 commits into
Lestropie wants to merge 4 commits into
Conversation
Diagnosed and fixed a Windows MSYS2 link failure in which the GUI commands shview and mrview failed with undefined references to wglGetProcAddress. Newer Qt5 / mingw-w64 packaging, together with the stricter binutils linker shipped in the GCC 16 toolchain, no longer lists the OpenGL import libraries in qmake's LIBS line nor pulls them in transitively under --as-needed, leaving the direct wglGetProcAddress call in gl_core_3_3.cpp unresolved. The configure script now appends -lopengl32 and -lgdi32 to the GUI link flags on Windows so the OpenGL dependency is satisfied. A new configure-time compile-and-link check exercises the same per-platform OpenGL proc-address resolver used by gl_core_3_3.cpp, reproducing the GUI link dependency so a missing OpenGL library aborts configuration with a clear message instead of surfacing later during the build. Session prompts: 1. > Attempting to compile this branch in Windows MSYS2 with a fresh configuration fails with the compilation message pasted below. There have recently been compilation / linking issues with this project on Windows MSYS2 due to changes introduced in GCC 16. Investigate and propose modifications to try. Note that the filesystem structure and compilation process differ on this branch to that for which Claude has been provided instructions. > ERROR: (11/88) [LB] bin/shview.exe > g++ tmp/src/gui/opengl/font.o tmp/src/gui/dialog/report_exception.o tmp/src/gui/shapes/halfsphere.o tmp/src/dwi/directions/predefined.o tmp/src/gui/dwi/render_frame.o tmp/cmd/shview.o tmp/src/gui/shview/render_window.o tmp/src/dwi/directions/set.o tmp/src/gui/dialog/dialog.o tmp/src/gui/crosshair.o tmp/src/gui/opengl/shader.o tmp/src/gui/dwi/render_frame_moc.o tmp/src/gui/shview/file_open.o tmp/src/exec_version.o tmp/src/gui/dialog/file.o tmp/src/gui/dialog/progress.o tmp/src/gui/gui.o tmp/src/gui/lighting_dock.o tmp/src/gui/lighting_dock_moc.o tmp/src/gui/dwi/renderer.o tmp/src/gui/projection.o tmp/src/gui/opengl/gl_core_3_3.o tmp/src/gui/color_button.o tmp/src/gui/opengl/gl.o tmp/src/gui/shview/icons.o tmp/src/gui/color_button_moc.o tmp/src/gui/opengl/lighting.o tmp/src/gui/shview/render_window_moc.o tmp/src/gui/dialog/list.o tmp/src/gui/opengl/lighting_moc.o tmp/src/gui/dialog/dicom.o -lmrtrix -Wl,--sort-common,--as-needed -pthread -Wl,--allow-multiple-definition -lz -ltiff -lpng16 -lfftw3 -L./bin C:/msys64/mingw64/lib/libQt5OpenGL.dll.a C:/msys64/mingw64/lib/libQt5Svg.dll.a C:/msys64/mingw64/lib/libQt5Widgets.dll.a C:/msys64/mingw64/lib/libQt5Gui.dll.a C:/msys64/mingw64/lib/libQt5Network.dll.a C:/msys64/mingw64/lib/libQt5Core.dll.a -lmingw32 C:/msys64/mingw64/lib/libqtmain.a -lshell32 -o bin/shview.exe > failed with output > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: tmp/src/gui/opengl/gl_core_3_3.o:gl_core_3_3.cpp:(.text+0x5e): undefined reference to `__imp_wglGetProcAddress' > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: tmp/src/gui/opengl/gl_core_3_3.o:gl_core_3_3.cpp:(.text+0x11d): undefined reference to `__imp_wglGetProcAddress' > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: tmp/src/gui/opengl/gl_core_3_3.o:gl_core_3_3.cpp:(.text+0x18d): undefined reference to `__imp_wglGetProcAddress' > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: tmp/src/gui/opengl/gl_core_3_3.o:gl_core_3_3.cpp:(.text+0x1fd): undefined reference to `__imp_wglGetProcAddress' > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: tmp/src/gui/opengl/gl_core_3_3.o:gl_core_3_3.cpp:(.text+0x26d): undefined reference to `__imp_wglGetProcAddress' > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: tmp/src/gui/opengl/gl_core_3_3.o:gl_core_3_3.cpp:(.text+0x2e0): more undefined references to `__imp_wglGetProcAddress' follow > collect2.exe: error: ld returned 1 exit status 2. > Within the configure script, add a new test command for compilation & linking that would have resulted in catching this linking fault during execution of the configure script. Generated-by: Claude Opus 4.8 <noreply@anthropic.com>
jdtournier
previously approved these changes
Jun 17, 2026
jdtournier
enabled auto-merge
June 17, 2026 10:44
jdtournier
disabled auto-merge
June 17, 2026 10:45
Member
|
Seems there are additional issues introduced with C++14: and There may be other warnings too, hard to tell given how often these ones popped up in the output... |
Member
Author
|
Residual compilation errors are exclusively on the Eigen 5 workflow, which should be rectified by #3409. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Discovered while attempting to compile and test #3389.
Description in 080201e.