Xcode'体系结构x86_64的未定义符号:'错误?
问题描述:
Error: " Undefined symbols for architecture x86_64:
"f(int, int, int const (*) [8], int const (*) [8], int*, int*)", 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)
我试着在Visual Studio 2010上运行完全相同的代码,它工作正常!任何想法为什么它不起作用?我的Mac是64位。谢谢!Xcode'体系结构x86_64的未定义符号:'错误?
这里是上竟然放弃错误的文件中的代码:
#include <iostream>
using namespace std;
int p,q;
int f(int, int,const int [][8],const int [][8], int [],int []);
答
出现这种情况,如果你没有提供您的F(..)函数的实现。
在你的main.cpp文件,只需实现的功能,如:
int f(int, int,const int [][8],const int [][8], int [],int [])
{
// Do stuff...
}
你定义函数'F()'? – Matthias 2012-04-23 18:13:29
请检查编辑。 – Adzi 2012-04-23 18:18:10
这是一个声明,但没有定义。你有没有定义它? – Matthias 2012-04-23 18:23:28