• Register
0 votes
2.4k views

Problem :

I am trying to use the eclipse CDT to test my Intel instructions and following is my program:

#define cpuid(func,jx,kx,lx,mx)\

__asm__ __volatile__ ("cpuid":\

 "=j" (jx), "=k" (kx), "=l" (lx), "=m" (mx) : "j" (func));

int Check_CPU_support_AES()

 {

 unsigned int j,k,l,m;

 cpuid(1, j,k,l,m);

 return (l & 0x2000000);

 }

But when I try to compile my above code, I face below linkage error as:

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 `WinMain@16'

collect2.exe: error: ld returned 1 exit status

Please let me know if anybody have any solution regarding the above issue.

7.5k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

Yes I know about it. Your Main () function is missing and the compiler is unable to get an entry point to start executing your program.

And one more reason is that even if you have written your main function but if you forgot to save your .cpp file and still tried to compile it then it will give the same error. So please make sure that you have successfully saved your .cpp file and after that compile and run the code.

Hope this will help you in resolving your issue.

38.6k points

Related questions

0 votes
1 answer 81 views
81 views
Problem: I am trying to solve this, and need help: Undefined reference to `winmain@16' collect2.exe: error: ld returned 1 exit status
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
1 answer 281 views
0 votes
1 answer 71 views
71 views
Problem: Does anyone have the skills to resolve this error? Collect2.exe error ld returned 1 exit status arduino.
asked May 19 Danyal Sjoerd 19.2k points
0 votes
1 answer 15 views
15 views
Problem: (.text+0x20): undefined reference to `main' collect2: error: ld returned 1 exit status.
asked Jul 3 Priscilla Gurpreet 74.7k points
0 votes
1 answer 27 views
27 views
Problem: I'm seeking a solution: Undefined reference to `pthread_create' collect2: error: ld returned 1 exit status?
asked May 27 Hridoy 19.2k points
0 votes
1 answer 50 views
50 views
Problem: Collect2.exe: error: ld returned 1 exit status
asked Jul 5 Shifa 18.2k points
0 votes
1 answer 4 views
4 views
Problem : Collect2 exe error ld returned 1 exit status.
asked Jul 10 Isac Christiaan 103k points
0 votes
1 answer 9 views
9 views
Problem: Collect2.exe error ld returned 1 exit status.
asked Jul 9 akhi 125k points
0 votes
1 answer 24 views
24 views
Problem: Collect2 error ld returned 1 exit status
asked Jul 18 asha 121k points
0 votes
1 answer 23 views
23 views
Problem: Collect2: error: ld returned 1 exit status.
asked Jul 13 Rada Gracelynn 104k points