【发布时间】:2016-07-05 05:00:12
【问题描述】:
我正在尝试编译以下内容
#include <GLFW/glfw3.h>
int main()
{
glfwInit();
return 0;
}
只是为了验证我的 GLFW 安装是否正常。我使用终端与
clang++ -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -I/opt/local/include/ test.c
但我收到 glfwInit 函数的链接器错误:
Undefined symbols for architecture x86_64:
"_glfwInit", referenced from:
_main in test-d8c21e.o
ld: symbol(s) not found for architecture x86_64
我已经使用sudo port install glfw 安装了 glfw,并按照我找到的所有可能的教程进行操作。我可以验证libglfw.dylib 文件是否可以在/opt/local/lib/ 上找到(我认为)。
有什么建议吗?
【问题讨论】: