Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"undefined reference to main"

Status
Not open for further replies.

SotonStu

Programmer
May 7, 2003
33
0
0
GB
I'm trying to compile a .cpp file but i keep on getting a compiler error that reads:
J:\quincy2000\mingw32\bin\..\lib\gcc-lib\i386-mingw32msvc\2.95.2\..\..\..\..\i386-mingw32msvc\lib\libmingw32.a(main.o)(.text+0x8e): undefined reference to `WinMain@16'

i'm using a windows compiler called quincy2000 which works fine, and i get the same error when i use g++ in a unix box.
There is deliberately no main method in my .cpp file so where is this error from?
 
>> so where is this error from?

From the compiler settings being used for that file.

-pete
[sub]I just can't seem to get back my IntelliSense[/sub]
 
I'm still not sure what you mean, the compiler appears to work fine, i've tried it on several different compilers and the same error occurs
 
WinMain is a GUI Window's program entrance point. This will happen if you don't make a WinMain function.
 
>> the compiler appears to work fine

yeah, sorry... should have said build settings (options/switches) for that file

-pete
[sub]I just can't seem to get back my IntelliSense[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top