1
当我编译下面的程序时,它给了我这个错误。GCC错误,但VS没有错误
/tmp/ccwr6gsJ.o: In function 'main':
main.cL(.text+0xa): undefined reference to 'example'
collect2: error: Id returned 1 exit status
MAIN.C:
#include <stdio.h>
#include "includes.h"
int main()
{
int exampleInt = example();
return 0;
}
INCLUDES.H:
int example();
includes.c:
#include "includes.h"
int example()
{
int i = 3;
return i;
}
似乎在Visual Studio中,但没有上下班GCC on Linux
它的工作原理!谢谢! – ChrisK