• Register
0 votes

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.

6 5 3
7,540 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.

9 7 4
38,600 points

Related questions

0 votes
1 answer 13 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 119 views
0 votes
1 answer 12 views
Problem: When I try to build a program using Eclipse CDT, I get the following: /mingw/lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16 Why is that? And, how can I solve this issue?
asked Mar 16 ummesalma 24.5k points
0 votes
1 answer 29 views
Problem: I am learning to use functions, in this case it asks me that the function receives parameters and does not return anything, but I got that error and I don't know why. The truth is I saw huge amounts of videos explaining how to do it, let's say it was "understood" and I tried to apply them, but ... } void sample2 (int l2 [], int size) { for (int i = 0; i <tam; i ++) cout << l2 [i] << ""; }
asked Dec 4, 2020 sasha 16.2k points
0 votes
1 answer 6 views
Problem: What will be the solution of the error:ld return 1 exit status?
asked Mar 26 ashik 11.2k points
1 vote
1 answer 95 views
Problem: Learning programming is fun, but it becomes hectic alongside sometimes. I am a novice in C/C++ programming and I&rsquo;ve written a program that should check student grade/mark but the program is not working for me. Please find my sample code snippet below and let me know ... ; break; case 3: print("Grade 3"); default: print ("Error"); } return 0; } Thanks for your kind concern guys.
asked Apr 9, 2020 Gavin 15.3k points
0 votes
1 answer 2 views
Problem: Kindly tell me how to do it .. 1d returned 1 exit status c++
asked Apr 2 Ifra 24.4k points
0 votes
1 answer 1 view
1 view
Problem: I installed Android Studio and I had no problems with that. However, when I tried to run the emulator, it said that Intel HAXM was not installed. Can someone help me with this?
asked 18 hours ago ummesalma 24.5k points
0 votes
1 answer 34 views
0 votes
1 answer 95 views
Problem Hey, I Am facing an error at the time of compilation. Compiler says permission denied and Id returned to 1 exit status. Someone can help me resolve this error. That will be helpful for me. Here&rsquo;s my binary search algorithm code that I was trying to compile. Algorithm: #include <stdio.h>         ...          printf("Your value is not in the array.");                          }    } }
asked Dec 21, 2020 chris jordan 2.4k points