• 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

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

1 vote
1 answer 41 views
Problem: Learning programming is fun, but it becomes hectic alongside sometimes. I am a novice in C/C++ programming and I’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 Gavin 15.3k points
0 votes
1 answer 29 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 Raphael Pacheco 4.9k points
1 vote
1 answer 194 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 stewart 4k points
0 votes
2 answers 292 views
My java program is running but the eclipse IDE crashes and shows the error message- “Java was started but returned exit code=1” I have set my environment variables correctly on my “System Environment Variables” 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 LizzyM 6.1k points