msys2 / MSYS2-packages

Package scripts for MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
1.28k stars 484 forks source link

[BUG]can not link libopengl32.a on WINDOWS #2020

Open dangyajun opened 4 years ago

dangyajun commented 4 years ago

QQ截图20200623163800

Describe the bug

Using cmake compile glew failed

C:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.1.0/../../../../i686-w64-mi ngw32/bin/ld.exe: CMakeFiles/visualinfo.dir/objects.a(visualinfo.c.obj):visualin fo.c:(.text+0x1ee4): undefined reference to _imp__wglMakeCurrent@8' C:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.1.0/../../../../i686-w64-mi ngw32/bin/ld.exe: CMakeFiles/visualinfo.dir/objects.a(visualinfo.c.obj):visualin fo.c:(.text+0x1f29): undefined reference to_impwglMakeCurrent@8' C:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.1.0/../../../../i686-w64-mi ngw32/bin/ld.exe: CMakeFiles/visualinfo.dir/objects.a(visualinfo.c.obj):visualin fo.c:(.text+0x1f3d): undefined reference to _imp__wglGetCurrentContext@0' C:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.1.0/../../../../i686-w64-mi ngw32/bin/ld.exe: CMakeFiles/visualinfo.dir/objects.a(visualinfo.c.obj):visualin fo.c:(.text+0x1f47): undefined reference to_impwglDeleteContext@4' C:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/10.1.0/../../../../i686-w64-mi ngw32/bin/ld.exe: lib/libglew.a(glew.c.obj):glew.c:(.text+0x446): undefined refe rence to `_imp__wglGetProcAddress@4'

Steps to Reproduce the Problem

  1. Run 'cmake ../ -G"Unix Makefiles" in build directory'
  2. Catch the error

Additional Context: Operating System, Screenshots

If applicable, add screenshots to help explain your problem.

Biswa96 commented 4 years ago

Possible solutions:

dangyajun commented 4 years ago

But glew can build sucessfully by tdm-gcc without any change.

dangyajun commented 4 years ago

Tomorrow I will try it again with 64bit msys2.Thank you very much.