所以我正在尝试用 g++ 创建一个 exec。我的命令如下:
g++ -o project21 main.cpp tools.hpp file.hpp FileInfo.cpp file.cp tools.cpp
我收到一个错误
ld: warning: ignoring file tools.hpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: ignoring file file.hpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
这里的行为很奇怪,我可以在 XCode 中编译它并使用 exec 就好了,它只是在我遇到问题的 shell 中。