だから私は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 を問題なく使用できるのは奇妙なことです。問題が発生しているのはシェルだけです。