build立我的项目时,我得到了一些未定义的参考。 这是构build日志:
**** 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
它是否正确? 我正在使用glew的64位二进制文件(我认为32位并不意味着什么)。 他们只是想用于视觉工作室吗?
如何在Eclipse中使用C ++(非控制台应用程序)构buildWindows GUI应用程序
Eclipse CDT项目中没有索引从SVN签出
OpenVC 2.4.5,eclipse CDT Juno,MinGW错误0xc0000005
嘟嘟声()函数在C ++中“没有在范围内声明”
使:***没有规则,使目标“全部”。 停止。 Eclipse错误
#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。
Eclipse CDT:Symbol'cout','map','vector','size_t'等无法parsing
Linux IDE支持STLdebugging
Eclipse CDT – 程序“make”无法find(win7,mingw,msys安装)
Eclipse远程debugging无法连接到X服务器
Eclipse的makefile生成缓慢…什么给了?
我解决了“glew undefined reference”问题。
我的开发环境是在Windows 7(x64)上使用MinGW的Eclipse CDT。
解决方案是以下3个步骤:
添加链接器标志: -lglew32s -lopengl32 -lfreeglut
添加编译标志: gcc -DGLEW_STATIC
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。