Compiling Simple static OpenGL 4.0 program using MinGW, freeglut and glew

烈酒焚心 提交于 2019-11-29 04:46:55

Try adding -lopengl32 last on the line to compile your program and see if it helps.

Argument order is significant with gcc linker options.

Try this:

${G++} -DFREEGLUT_STATIC -DGLEW_STATIC -m32 main.cpp -o main.exe -I ${ROOTPATH}/include -L ${ROOTPATH}/lib -lopengl32 -lwinmm -lgdi32 -lglew32 -static -lfreeglut_static 

Also, I don't think there's a double-dash --static option, just -static.

And on win32 you're going to need a successful glewInit() before your glEnableVertexAttribArray() function pointer will be valid. After checking your core version and/or extension, of course :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!