架构x86_64: party::getArrival()的未定义符号
Undefined symbols for architecture x86_64: party::getArrival()
我有一个名为party.h
的party
类的头文件:
#ifndef party_h
#define party_h
#include <iostream>
class party{
private:
int people;
int waitTime;
bool waiting;
int arrival;
public:
party();
party(int, int);
int getPeople();
void setPeople(int);
bool isWaiting();
void setWaiting(bool);
void setWaitTime(int);
int getwaitTime();
void setArrival(int);
int getArrival();
int getTotalTime(int);
void decrement();
};
#endif
及其在party.cpp
中的实现:
#include "party.h"
party::party(){}
party::party(int numPeople, int a){
people = numPeople;
arrival = a;
}
int party::getPeople(){
return people;
}
void party::setPeople(int p){
people = p;
}
bool party::isWaiting(){
return waiting;
}
void party::setWaiting(bool w){
waiting = w;
}
void party::setWaitTime(int t){
waitTime = t;
}
int party::getwaitTime(){
return waitTime;
}
void party::setArrival(int a){
arrival =a;
}
int party::getTotalTime(int current){
return (current-arrival);
}
每当我构建项目时,我都会得到下面的错误消息,
Ld /Users/shade/Library/Developer/Xcode/DerivedData/ResSim-fvkhqxhiupiizxgffxqgoxgolsmv/Build/Products/Debug/ResSim normal x86_64 cd /Users/shade/Dropbox/School/Gwinnett_Tech/CIST_2362/final/ResSim setenv MACOSX_DEPLOYMENT_TARGET 10.8 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/shade/Library/Developer/Xcode/DerivedData/ResSim-fvkhqxhiupiizxgffxqgoxgolsmv/Build/Products/Debug -F/Users/shade/Library/Developer/Xcode/DerivedData/ResSim-fvkhqxhiupiizxgffxqgoxgolsmv/Build/Products/Debug -filelist /Users/shade/Library/Developer/Xcode/DerivedData/ResSim-fvkhqxhiupiizxgffxqgoxgolsmv/Build/Intermediates/ResSim.build/Debug/ResSim.build/Objects-normal/x86_64/ResSim.LinkFileList -mmacosx-version-min=10.8 -stdlib=libstdc++ -o /Users/shade/Library/Developer/Xcode/DerivedData/ResSim-fvkhqxhiupiizxgffxqgoxgolsmv/Build/Products/Debug/ResSim
Undefined symbols for architecture x86_64: "party::getArrival()", referenced from: restaurant::startSim() in restaurant.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
"party::getArrival()", referenced from: Restaurant::startSim() in restaurant.o Symbol(s) not found for architecture x86_64 Linker command failed with exit code 1 (use -v to see invocation)
这是一个新的错误信息,因为它在今天早些时候/这个周末在visual studio中工作。但从那以后,我已经修改了相当数量的代码,要点中的代码已经更新,这就是我正在使用的代码。我目前正试图让它在xcode中构建,这样我就可以完成调试/编程我的项目,这是今晚到期。任何帮助都非常感谢!谢谢!
您没有在party.cpp
文件中定义getArrival
。您可能需要:
int party::getArrival(){
return arrival;
}
相关文章:
- vscode g++链路故障:体系结构x86_64的未定义符号
- 体系结构x86_64的未定义符号:std:terminate(),typeinfo,运算符delete[],运算符new
- C++ 中 dlsym 的未定义符号
- 仅在 MacOS 上析构函数的未定义符号
- OSX clang++:用于 cpp 文件中显式实例化模板的体系结构x86_64的未定义符号
- PCL 出错:体系结构x86_64 @pcl的未定义符号
- clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用) - 体系结构的未定义符号 x86_64:
- 体系结构x86_64的未定义符号:链接器错误
- C++ std::vector<int> 体系结构的未定义符号 x86_64:
- 生成文件:体系结构x86_64的未定义符号
- libc++abi未定义符号:_ZTVN10__cxxabif120__si-class_type_infoE
- Xcode"体系结构x86_64的未定义符号"
- 体系结构x86_64的未定义符号:找不到原因
- SWIG链接器:未定义符号:_ZN2cv8fastFreeEPv(cv::fastFree(void*))
- 如何修复架构x86_64的未定义符号,Boost Asio 1.58
- 在Qt5上去静态库:架构的未定义符号x86_64:
- 体系结构x86_64的未定义符号:c++/ h 文件和 cpp 文件
- 监视 SDK 下的未定义符号"__Unwind_SjLj_Unregister"
- 使用 Boost/Python 的未定义符号 - 复杂
- 建筑x86_64的未定义符号:"vtkDebugLeaksManager::vtkDebugLeaksManager()",引用自: