这段程序为什么编译的时候没错,在执行的时候报错
#include<stdio.h>int cude(int);
void main (void)
{
printf("cube(3) =%d\n",cube(3));
printf("cube(5) =%d\n",cube(5));
printf("cube(8) =%d\n",cube(8));
}
int cube (int x){return x*x*x;}
报错:
--------------------Configuration: Func1 - Win32 Debug--------------------
Linking...
Func.obj : error LNK2005: _main already defined in Func1.obj
Func.obj : error LNK2005: _cube already defined in Func1.obj
Func1.obj : error LNK2001: unresolved external symbol _prinyf
Debug/Func1.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
Func1.exe - 1 error(s), 0 warning(s)