好吧,我是新来的C++,所以我想了解什么信息可以从错误消息中获得。了解“未定义的架构符号”错误
以下是错误消息
Undefined symbols for architecture x86_64: "PieceClothing::PieceClothing(int)", referenced from: ClothesInventory::getPieceOfClothing(long) in ClothesInventory.o ClothesInventory::insertIntocloset(std::basic_string, std::allocator >)in ClothesInventory.o "PieceClothing::PieceClothing()", referenced from: ClothesInventory::ClothesInventory()in ClothesInventory.o ClothesInventory::ClothesInventory(std::basic_string, std::allocator >)in ClothesInventory.o std::map, std::allocator > >::operator[](long const&)in ClothesInventory.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status
这里是我的理解:
- 有两种错误;
- 一个与getPieceOfClothing和insertIntocloset有关的事情;
- 其他在构造函数中可能是关于我在那里的地图和/或迭代器。
只是为了澄清,我没有附上代码,因为问题的关键是要了解我能从信息中得到的所有信息。
感谢您的任何帮助。
'for architecture' - 您是否正在使用可能一次链接多个体系结构的工具链,例如: Mac连接x64和PPC?我认为这是一个红鲱鱼 - 它只是告诉你,它无法找到PieceClothing构造函数的实现 - 你是否明确实现了这些?你是否确实将它们连接起来? – Rup 2012-04-27 11:00:23