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