C++ Xcode 未定义的架构符号
C++ Xcode Undefined symbols for architecture
当我尝试使用 Xcode 编译代码时,我收到一个错误。您可以在此处看到错误:
Undefined symbols for architecture x86_64:
"Sun::Datum2JDatum(Sun::Time)", 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)
在我看来,他没有看到我的太阳档案。在我看来,我包含了一切。但我没有发现问题所在。谁能告诉我我做错了什么?
这是我的主要.cpp:我包括了我需要的所有库以及我的 Sun.hpp。
#include <iostream>
#include <time.h>
#include "Sun.hpp"
using namespace std;
int main(int argc, const char * argv[]) {
struct tm* timeinfo;
static char buf[200];
time_t now = time(NULL);
timeinfo = localtime(&now);
Sun::Sun sunposition;
Sun::Time time;
// ...
Sun::JDatum datum = sunposition.Datum2JDatum(time); // Here I got the Error
return 0;
}
周日.hpp:
class Sun{
public:
typedef struct{
double jd;
double jd0;
double T;
double T0;
} JDatum;
Coordinates Locationdetermination(Sun::JDatum, Sun::Location);
JDatum Datum2JDatum(Sun::Time);
};
周日.cpp:
同样在Sun中.cpp还包括Sun.hpp。
#include "Sun.hpp"
using namespace std;
Sun::JDatum Datum2JDatum(Sun::Time Now){
//...
}
我找不到真正的错误。如果你能帮我解决问题,那就太好了。
在 Sun 中.cpp更改为:
JDatum Sun::Datum2JDatum(Sun::Time Now){
//...
}
相关文章:
- MacOS 上的 Xcode 11 项目不在一个函数中使用 sin 和 cos:未定义的符号"___sincosf_stret"
- Xcode"体系结构x86_64的未定义符号"
- C++ XCODE ld:找不到体系结构x86_64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -
- XCODE OC / C++,超过2个文件,重复符号
- ld:Xcode 中架构x86_64的 1 个重复符号
- C++ Xcode 未定义的架构符号
- 找不到体系结构x86_64(带xcode的OpenGL)的符号
- 体系结构x86_64的未定义符号:Xcode 5 问题
- Xcode 无法找到x86_64架构的符号
- 如何删除LD:Xcode 4.2(C 代码)中的重复符号_
- C++和 Xcode 中出现重复符号错误
- XCode无法编译Poco项目,未定义符号
- 在Xcode中调试一个没有调试符号的dylib
- Xcode LD:8 个重复符号,用于架构x86_64
- Xcode C++ :: 体系结构x86_64的重复符号
- Xcode 错误:架构 x86_44 和 ld 的未定义符号:找不到架构x86_64的符号
- Xcode 代码感知不起作用(找不到符号)
- Xcode:为什么重命名为 .mm 失败,仅在静态库中"___gxx_personality_sj0"未定义的符号?
- OpenCV, XCode 中的链接错误, 架构的未定义符号 x86_64: "_cvHaarDetectObjects" , 引用自: _main in main.o
- c++Mac Xcode:体系结构x86_64:的未定义符号