Hello,
I am unable to cross-compile (linux -> windows) glew-1.13.0:
$ make SYSTEM=linux-mingw32 CC=i686-pc-mingw32-gcc LD=i686-pc-mingw32-ld i686-pc-mingw32-gcc -DGLEW_NO_GLU -DGLEW_BUILD -O2 -Wall -W -Iinclude -o tmp/linux-mingw32/default/shared/glew.o -c src/glew.c i686-pc-mingw32-ld -shared -soname libglew32.dll --out-implib lib/libglew32.dll.a -o lib/glew32.dll tmp/linux-mingw32/default/shared/glew.o -lopengl32 -lgdi32 -luser32 -lkernel32 tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x3cc): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x3e8): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x404): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x418): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x42c): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x440): more undefined references to `wglGetProcAddress@4' follow tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x1783f): undefined reference to `wglGetCurrentDC@0' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x178af): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x178c3): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x178de): undefined reference to `wglGetCurrentDC@0' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x1795a): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x17ae0): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x17afc): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x17b1a): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x17efc): undefined reference to `wglGetProcAddress@4' tmp/linux-mingw32/default/shared/glew.o:glew.c:(.text+0x17f18): more undefined references to `wglGetProcAddress@4' follow make: *** [lib/glew32.dll] Error 1
Any idea why?
Thank you.
Best regards.
Seems to work for me on Ubuntu 15.04. Can you describe more about your setup?
My setup is Slackware 14.1 and:
- i686-pc-mingw32-binutils-2.24.51
- i686-pc-mingw32-gcc-4.9.1
- i686-pc-mingw32-mesa-9.1.3
- i686-pc-mingw32-mingwrt-3.20.2
- i686-pc-mingw32-w32api-3.17.2
But don't worry because the problem seems to come from an other software than glew.
Indeed, I discovered that glfw-3.1.1 that is also using the opengl32 library shows the same error:
So, there are a lot of chance that the problem comes from the "i686-pc-mingw32-mesa-9.1.3" package that provides the "/usr/i686-pc-mingw32/lib/libopengl32.a" file.
I have reported the bug to mesa too [1].
Maybe this can help to understand the problem:
Can you check if you have the same result with the "nm" command and your "libopengl32.a" file?
[1] https://bugs.freedesktop.org/show_bug.cgi?id=91711
Last edit: YuGiOhJCJ 2015-08-24
OK I found how to solve this problem.
Instead of using the libopengl32.a file provided by mesa I need to use the one provided by my cross-compiler.
The problem is that my current cross-compiler [1] does not provide the /usr/i686-pc-mingw32/lib/libopengl32.a file.
So, I have installed a new cross-compiler [2] that does correctly the job.
Now, my cross-compiler already provides a /usr/i686-pc-mingw32/lib/libopengl32.a file.
So, I should not cross-compiling mesa because it will overrides this file that will contain incorrect symbols.
The libopengl32.a provided by my new cross-compiler contains the correct symbols:
The question is why I need to use the library provided by my cross-compiler and not the one from mesa?
I don't know, but what is sure is that the problem is not related to the glew project.
[1] http://www.mingw.org/
[2] http://mingw-w64.org
Oh good. It does make sense to depend on the windows opengl32.dll, rather than Mesa.
Closing, resolved.