2
我使用的Eclipse CDT測試英特爾指令和下面是我的程序:未定義的參考`的WinMain @ 16' collect2.exe:錯誤:LD返回1個退出狀態
#define cpuid(func,ax,bx,cx,dx)\
__asm__ __volatile__ ("cpuid":\
"=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func));
int Check_CPU_support_AES()
{
unsigned int a,b,c,d;
cpuid(1, a,b,c,d);
return (c & 0x2000000);
}
當我編譯以上代碼,我得到鏈接錯誤爲:
Info: Internal Builder is used for build
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\Intel.o" "..\\src\\Intel.c"
gcc -o Intel.exe "src\\Intel.o"
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference to `[email protected]'
collect2.exe: error: ld returned 1 exit status
請幫我解決這個問題。
這看起來不像整個程序。 WinMain在哪裏? – Inisheer
他沒有「WinMain」 - 這就是他得到錯誤的原因。 –