0
失踪时,我曾试图汇编http://www.glfw.org/documentation.html为glfw3示例代码glfw3具体refrences(复制/粘贴到测试编译),我得到了以下错误:与glfw3
/tmp/ccCdEKoi.o: In function main':
example.cpp:(.text+0x38): undefined reference toglfwCreateWindow'
example.cpp:(.text+0x5b): undefined reference to glfwMakeContextCurrent'
example.cpp:(.text+0x7a): undefined reference toglfwWindowShouldClose'
collect2: error: ld returned 1 exit status
我与g++ example.cpp -o example -lGL -lglfw
编译和当我安装最新的glfw 3.0.2时,它安装时没有问题。
如果我这样做,这会让我X11相关的错误的转换。我认为我之前用一些Google搜索功能修复了这个问题,所以我会尝试重新搜索错误。结果不会太多,但有一个确实解决了问题。 – cellsheet
X11相关的错误听起来像你正在静态链接到GLFW。我正在使用'-lglfw3 -lX11 -lXxf86vm -lpthread -lrt -lXrandr -lXi'来成功完成此操作。 –