• 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 43 views
0 votes
1 answer 15 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 6.4k points
1 vote
1 answer 50 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 22 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.2k points
0 votes
2 answers 69 views
Problem : I had tried to run the Hello World application in the Android Studio. But I got the following error: Emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAX kernel module is not installed! Can anyone tell me what can I do to fix the above error?
asked Dec 27, 2019 alecxe 7.5k points
0 votes
1 answer 115 views
On installing odoo-server, I got the following error: error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Could anyone help me to solve this issue?
asked Oct 30, 2020 psandprop 2.4k points
0 votes
1 answer 170 views
Problem: I have basic knowledge of Arduino.If I try to compile my Arduino UNO sketches by using the official latest version of Arduino software on my Windows 7 then I face this error: sketch\sketch_may21a.ino.cpp:1:21: fatal error: Arduino.h: No such file or ... tried many things but unable to fix the above error. I am looking for guidance from an Arduino UNO expert to fix the above error.
asked Aug 28, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 409 views
Problem : I have recently started working on Raspbeery Pi3 Raspbian Jessie Pixel (latest) Python 3.4 Now a days I am trying to install the PySFTp but I am always getting stuck. I have installed all the dependencies one by one as required. I had installed ... Python3-dev stuff necessary together with using below command: apt-cache search gnutls | grep dev Please guide me in fixing above error.
asked May 5, 2020 stewart 4k points
1 vote
2 answers 454 views
My java program is running but the eclipse IDE crashes and shows the error message- &ldquo;Java was started but returned exit code=1&rdquo; I have set my environment variables correctly on my &ldquo;System Environment Variables&rdquo; settings. I have tried some other solutions found online but nothing worked for me unfortunately. Any help would be appreciated with thanks.
asked Mar 10, 2020 LizzyM 6.1k points
0 votes
1 answer 488 views