C ++:Xcode中体系结构x86_64的未定义符号

时间:2018-07-05 14:15:13

标签: c++ xcode opengl

首先,我试图在项目中使用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”,则错误保持不变。 任何帮助表示赞赏。

0 个答案:

没有答案