G ++警告:为不支持的文件格式构建,而不是链接的体系结构
每当我尝试编译我的项目时(使用命令行
g++ *.hpp *.cpp 2> log.txt
),这就是我得到的:
log.txt
:
ld: warning: in configfile.hpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: in erase.hpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: in filehandler.hpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: in insert.hpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: in operation.hpp, file was built for unsupported file format which is not the architecture being linked (x86_64)
有关为什么会发生这种情况的任何想法?我在OSX 10.6下(使用最新的开发者工具)
没有找到相关结果
已邀请:
3 个回复
乐遣杀屎
请注意,只有一个.cpp文件可以具有main()函数 - 否则操作系统将无法知道入口点的位置。
青董据零
试试这个。您可以使用gcc编译头文件以生成预编译的头文件。
讹巳漓把备
应该适合你:
那是对的吗?