![](/img/trans.png)
[英]Compiling lsd_slam on OS X throws linking error ld: library not found for -lGL
[英]ld: library not found for -lGL Error
在MacOS上使用OpenGL時,必須將-lGL
替換為-framework OpenGL
。 過剩也是如此。 該命令應如下所示:
g++ -I/usr/local/include 01_triangle.cpp gl_framework.cpp shader_util.cpp -o 01_triangle -framework OpenGL -framework GLUT
還要注意,某些包含路徑在OSX上是不同的。 例如,Windows / Linux包括
#include <GL/gl.h>
#include <GL/glut.h>
必須替換為
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.