首先,我试图在项目中使用glad.h。 Xcode 7.2.1 。给我error
:
glad.h:26:2: OpenGL header already included, remove this include, glad already provides it.
这些是我的main.cpp
中的标题:
#include "glad/glad.h"
#include <iostream>
#include "GLFW/glfw3.h"
我将GLFW_INCLUDE_NONE
添加到包装中-预处理程序定义和LLVM-预处理程序宏(我想类似于Visual Studio中的预处理程序定义)。然后错误变为:
Undefined symbols for architecture x86_64:
"_glfwCreateWindow", referenced from:
_main in main.o
"_glfwGetPrimaryMonitor", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
如果我删除代码#include "glad/glad.h”
,则错误保持不变。
任何帮助表示赞赏。