【问题标题】:Eclipse C++ OpenGL - Cant Build ProjectEclipse C++ OpenGL - 无法构建项目
【发布时间】:2015-07-09 00:04:02
【问题描述】:

我刚刚在我的新电脑上安装了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)

我已经在网上搜索了解决方案,但似乎找不到有效的解决方案。

【问题讨论】:

    标签: c++ eclipse opengl linux-mint


    【解决方案1】:

    根据您的错误日志,您尚未链接-lGL。尝试将其添加到链接器设置中的库中

    【讨论】:

    • 是的,这就是我自己想出来的:/但我很欣赏你的回答:)谢谢d(^-c^ d)
    猜你喜欢
    • 2011-10-23
    • 1970-01-01
    • 2013-07-05
    • 1970-01-01
    • 2015-12-05
    • 1970-01-01
    • 1970-01-01
    • 2016-05-25
    • 1970-01-01
    相关资源
    最近更新 更多