Eclipse c++ OpenGL -不能构建项目

Eclipse C++ OpenGL - Cant Build Project

本文关键字:构建 项目 不能 c++ OpenGL Eclipse      更新时间:2023-10-16

我刚刚在我的新PC上安装了Eclipse(使用Mint 17.1),并且到目前为止几乎每个项目都遇到这个错误。问题是,当我想启动我的项目时,我得到错误:

"发射失败了。没有找到二进制文件。"

我已经尝试构建项目,但随后我得到2个错误:

./src/main.o: undefined reference to symbol 'glEnable'
make: *** [OpenGL] Fehler 1

下面是控制台日志:

01:49:45 **** Incremental Build of configuration Debug for project OpenGL ****
make all 
Building target: OpenGL
Invoking: GCC C++ Linker
g++ -L/usr/lib/ -L/usr/lib/x86_64-linux-gnu/mesa/ -o "OpenGL"  ./src/main.o   -lglut -lGLU
/usr/bin/ld: ./src/main.o: undefined reference to symbol 'glEnable'
//usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [OpenGL] Fehler 1
01:49:45 Build Finished (took 127ms)

我已经在网上搜索了解决方案,但我似乎找不到一个可行的解决方案。

根据您的错误日志,您没有链接-lGL。尝试将它添加到链接器设置

中的库中