windows – OpenGL GLEW MinGW应用程序链接问题
发布时间:2020-12-14 05:40:20 所属栏目:Windows 来源:网络整理
导读:在构建项目时,我得到了一些未定义的引用.这是构建日志: **** Build of configuration Debug for project test ******** Internal Builder is used for build ****g++ -O0 -g3 -Wall -c -fmessage-length=0 -o srcmain.o ..srcmain.cppg++ -O0 -g3 -Wall
在构建项目时,我得到了一些未定义的引用.这是构建日志:
**** Build of configuration Debug for project test **** **** Internal Builder is used for build **** g++ -O0 -g3 -Wall -c -fmessage-length=0 -o srcmain.o ..srcmain.cpp g++ -O0 -g3 -Wall -c -fmessage-length=0 -o srctest.o ..srctest.cpp g++ -O0 -g3 -Wall -c -fmessage-length=0 -o srcwindow.o ..srcwindow.cpp ..srcwindow.cpp: In member function 'void Window::StartRenderContext()': ..srcwindow.cpp:150:24: warning: NULL used in arithmetic ..srcwindow.cpp:161:28: warning: NULL used in arithmetic ..srcwindow.cpp:174:24: warning: NULL used in arithmetic g++ -mwindows -l glew32 -l glew32s -l glu32 -l opengl32 -o test.exe srcwindow.o srctest.o srcmain.o srcwindow.o: In function `ZN6Window18StartRenderContextEv': C:eclipseworkspacetestDebug/../src/window.cpp:101: undefined reference to `wglCreateContext@4' C:eclipseworkspacetestDebug/../src/window.cpp:102: undefined reference to `wglMakeCurrent@8' C:eclipseworkspacetestDebug/../src/window.cpp:115: undefined reference to `glewInit' C:eclipseworkspacetestDebug/../src/window.cpp:125: undefined reference to `wglMakeCurrent@8' C:eclipseworkspacetestDebug/../src/window.cpp:126: undefined reference to `wglDeleteContext@4' C:eclipseworkspacetestDebug/../src/window.cpp:148: undefined reference to `__wglewChoosePixelFormatARB' C:eclipseworkspacetestDebug/../src/window.cpp:159: undefined reference to `__wglewChoosePixelFormatARB' C:eclipseworkspacetestDebug/../src/window.cpp:185: undefined reference to `__wglewCreateContextAttribsARB' C:eclipseworkspacetestDebug/../src/window.cpp:194: undefined reference to `__wglewCreateContextAttribsARB' C:eclipseworkspacetestDebug/../src/window.cpp:204: undefined reference to `__wglewCreateContextAttribsARB' C:eclipseworkspacetestDebug/../src/window.cpp:214: undefined reference to `__wglewCreateContextAttribsARB' C:eclipseworkspacetestDebug/../src/window.cpp:227: undefined reference to `wglMakeCurrent@8' collect2: ld returned 1 exit status Build error occurred,build is stopped Time consumed: 8128 ms. 这是我的链接命令: g++ -mwindows -l glew32 -l glew32s -l glu32 -l opengl32 -o test.exe srcwindow.o srctest.o srcmain.o 它是否正确?我正在使用64位的glew二进制文件(我认为32s并不意味着什么).它们只是意味着与视觉工作室一起使用吗? 这是我的代码中的包含: #include "Windows.h" #include "GL/glew.h" #include "GL/wglew.h" #include "GL/gl.h" #include "GL/glu.h" #include "test.h" 我正在使用Eclipse Indigo CDT,MinGW,Win32,OpenGL和glew. 解决方法
我解决了“glew undefined reference”问题.
我的开发环境是在Windows 7(x64)上使用MinGW进行CDT的日食. 解决方案有以下3个步骤: >添加源代码:#define GLEW_STATIC 如果需要,你必须添加-lglu32 -glut32等. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
推荐文章
站长推荐
- windows-10 – 如何配置Windows 10不要在Edge中打
- 如何在Windows上切换到另一个应用程序(使用C,Qt)
- Windows上的Meteor JS,支持iOS和Android
- 是否可以从vbscript执行.NET程序集(DLL)?
- windows – 有没有办法改变MATLAB命令窗口的标题
- 如何直接在Windows桌面上绘制C#?
- iis – 集成Windows身份验证仅在IE中不起作用
- 适用于Windows程序员的最佳“官方”脚本语言[已关
- windows-server-2008 – 如何在Hyper-V管理器中合
- Windows Embedded Compact 7上真正的Silverlight
热点阅读