📌 Bug Report: Missing -lopengl32 in MinGW build on Windows (MSYS2)
Description
When building MRtrix3 on Windows using MSYS2 + MinGW-w64 (mingw64.exe shell), the build fails at the linking stage of mrview.exe with undefined references to __imp_wglGetProcAddress.
This happens because the -lopengl32 linker flag is not automatically included by the ./configure script under Windows/MinGW environments.
Steps to Reproduce
-
Install MSYS2 and open mingw64.exe shell
-
Install dependencies:
pacman -S git python pkg-config mingw-w64-x86_64-gcc mingw-w64-x86_64-eigen3 mingw-w64-x86_64-qt5 mingw-w64-x86_64-fftw mingw-w64-x86_64-libtiff mingw-w64-x86_64-libpng
-
Clone MRtrix3:
git clone https://github.com/MRtrix3/mrtrix3.git
cd mrtrix3
./configure
./build
-
Observe the following error during mrview.exe build:
undefined reference to `__imp_wglGetProcAddress`
System Info
- OS: Windows 11 x64
- Build environment: MSYS2 MinGW-w64 (
mingw64.exe)
- MRtrix3 commit: [insert SHA or date]
- Qt: 5.15.16
- GCC: 15.1.0 (MSYS2)
- OpenGL: via Qt, but needs explicit
-lopengl32
📌 Bug Report: Missing
-lopengl32in MinGW build on Windows (MSYS2)Description
When building MRtrix3 on Windows using MSYS2 + MinGW-w64 (
mingw64.exeshell), the build fails at the linking stage ofmrview.exewith undefined references to__imp_wglGetProcAddress.This happens because the
-lopengl32linker flag is not automatically included by the./configurescript under Windows/MinGW environments.Steps to Reproduce
Install MSYS2 and open
mingw64.exeshellInstall dependencies:
Clone MRtrix3:
git clone https://github.com/MRtrix3/mrtrix3.git cd mrtrix3 ./configure ./buildObserve the following error during
mrview.exebuild:System Info
mingw64.exe)-lopengl32