Eclipse C++ OpenGL - 无法构建项目
Eclipse C++ OpenGL - Cant Build Project
我刚刚在我的新 PC 上安装了 Eclipse
(使用 Mint 17.1
)并且 运行 几乎每个项目都出现了这个错误。问题是当我想启动我的项目时出现错误:
"Launch Failed. Binary not found."
我已经尝试构建项目,但随后出现 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
。尝试在链接器设置中将其添加到您的库中
我刚刚在我的新 PC 上安装了 Eclipse
(使用 Mint 17.1
)并且 运行 几乎每个项目都出现了这个错误。问题是当我想启动我的项目时出现错误:
"Launch Failed. Binary not found."
我已经尝试构建项目,但随后出现 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
。尝试在链接器设置中将其添加到您的库中