不能用mingw交叉编译opengl程序
Can't cross compile opengl program with mingw
我想从 debian
为 windows 编译程序
> '/opt/mingw32/bin/i686-w64-mingw32-g++' '/home/redrockfish/Projects/OpenGl0/main.cpp' -o arcanoid.exe -static-libstdc++ -static-libgcc -lglu32 -lopengl32 -lglut32
/tmp/ccrvQIKM.o:main.cpp:(.text+0x1c): undefined reference to `_imp____glutInitWithExit@12'
/tmp/ccrvQIKM.o:main.cpp:(.text+0x3e): undefined reference to `_imp____glutCreateWindowWithExit@8'
/tmp/ccrvQIKM.o:main.cpp:(.text+0x60): undefined reference to `_imp____glutCreateMenuWithExit@8'
/opt/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.0/../../../../i686-w64-mingw32/bin/ld: /tmp/ccrvQIKM.o: bad reloc address 0x0 in section `.ctors'
collect2: error: ld returned 1 exit status
如果我删除 -lglut32
未定义引用的数量会增加。 header if freeglut.h,取自官方网站。用 glut 替换 glut32,添加 -lGLU 没有帮助。与 -lGL
cannot find -lGL
collect2: error: ld returned 1 exit status
我想从 debian
为 windows 编译程序> '/opt/mingw32/bin/i686-w64-mingw32-g++' '/home/redrockfish/Projects/OpenGl0/main.cpp' -o arcanoid.exe -static-libstdc++ -static-libgcc -lglu32 -lopengl32 -lglut32
/tmp/ccrvQIKM.o:main.cpp:(.text+0x1c): undefined reference to `_imp____glutInitWithExit@12'
/tmp/ccrvQIKM.o:main.cpp:(.text+0x3e): undefined reference to `_imp____glutCreateWindowWithExit@8'
/tmp/ccrvQIKM.o:main.cpp:(.text+0x60): undefined reference to `_imp____glutCreateMenuWithExit@8'
/opt/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.0/../../../../i686-w64-mingw32/bin/ld: /tmp/ccrvQIKM.o: bad reloc address 0x0 in section `.ctors'
collect2: error: ld returned 1 exit status
如果我删除 -lglut32
未定义引用的数量会增加。 header if freeglut.h,取自官方网站。用 glut 替换 glut32,添加 -lGLU 没有帮助。与 -lGL
cannot find -lGL
collect2: error: ld returned 1 exit status