如何修复';d:找不到架构x86_64的符号clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)';? 我正在为我的C++程序编写一个测试平台,但我不能编译它。我总是遇到以下错误: ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

如何修复';d:找不到架构x86_64的符号clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)';? 我正在为我的C++程序编写一个测试平台,但我不能编译它。我总是遇到以下错误: ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation),c++,c++11,C++,C++11,当我使用-v时,我得到以下结果: clang -cc1 version 11.0.0 (clang-1100.0.33.12) default target x86_64-apple-darwin19.0.0 ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1" ignoring nonexistent directory "/Library/

当我使用-v时,我得到以下结果:

clang -cc1 version 11.0.0 (clang-1100.0.33.12) default target x86_64-apple-darwin19.0.0
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
 /usr/local/include
 /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1
 /Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/include
 /Library/Developer/CommandLineTools/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
End of search list.
clang-cc1版本11.0.0(clang-1100.0.33.12)默认目标x86\u 64-apple-darwin19.0.0
忽略不存在的目录“/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1”
忽略不存在的目录“/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include”
忽略不存在的目录“/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks”
#包括“…”搜索从这里开始:
#包括搜索从这里开始:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
/usr/本地/包括
/Library/Developer/CommandLineTools/usr/bin/./include/c++/v1
/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/include
/库/Developer/CommandLineTools/usr/include
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks(框架目录)
搜索列表结束。
我试图安装xcode,并通过brew更新pkg,但到目前为止都没有成功。我正在使用MacOS Catalina V.10.15.1

这是我正在尝试运行的代码:

logicgates.hpp:

#包括
#包括
#ifndef逻辑门\u水电站
#定义逻辑门\u水电站
类逻辑门
{
公众:
//门值的声明
向量输入;
整数输出;
int输入大小;
//收缩器和解构器
逻辑门();
虚拟逻辑门();
//函数声明
虚拟void SetInput(int-inputValue,int-inputNum);
虚拟整数计算输出();
虚拟void PrintInfo();
};
类和:公共逻辑门
{
公众:
//门值的声明
向量输入;
整数输出;
int输入大小;
//收缩器和解构器
和(int inputSizeAND);
~AND();
//函数声明
void SetInput(int inputValue,int inputNum);
int CalculateOutput();
void PrintInfo();
};
#恩迪夫
logicgates.cpp:

#包括“/logicgates.hpp”
#包括
#包括
使用名称空间std;
//-------------------------------------方法声明----------------------------------------
//---------逻辑门类------------------
LogicGates::LogicGates(){}//Constractor
LogicGates::~LogicGates(){}//析构函数
//方法
void LogicGates::SetInput(int-inputValue,int-inputNum){}
int LogicGates::CalculateOutput(){return 0;}
void LogicGates::PrintInfo(){}
//---------和类------------------
AND::AND(int-inputSizeAND)//构造函数
{
如果((inputSizeAND==1)| |(inputSizeAND==0)){

CUT考虑通过删除与代码无关的代码来生成A。problem@cpplearner这是一个最小的可重复的例子,原始代码要长得多。因为我是一个C++的乞丐,我不知道问题是来自代码还是别的什么。在<代码> Logic GATE.HPP<代码>中,有一个<代码> > IFNDEF < /代码>,没有匹配的<代码>f
@igortandtnik抱歉,当我最小化代码时,我忘记了这是我的错,但是如果
#endif
没有改变,我也有同样的错误。你是如何编译和链接代码的