I am making a basic window and keep getting the error:
LIBCS(crt0.obj) : error LNK2001: unresolved external symbol _main
Debub/Practice.exe : fatal error LNK1120: 1 unresolved externals
Anyone know a way to fix this?
Thank you
I am making a basic window and keep getting the error:
LIBCS(crt0.obj) : error LNK2001: unresolved external symbol _main
Debub/Practice.exe : fatal error LNK1120: 1 unresolved externals
Anyone know a way to fix this?
Thank you
I do not know if this is the problem, but the entrance function for Windows is WinMain and not main.
- Sean
If cities were built like software is built, the first woodpecker to come along would level civilization.
Black Frog Studios
Yeah, it is a winmain function. Actually its taken directly out of the windows programming for dummies book. Everything else is fine except that error.
When you created a new project you probably accidently selected Win32 Console Application instead of Win32 Application. To remedy this do as follows:
Project->Settings
Click the "Link" Tab
At the bottom you will notice a window titled Project Options: , once here scroll down until you see the following line..
/subsystem:_____
I bet yours says /subsystem:console . change console to windows and you shall be fine.
/subsystem:windows
Hope this helps.
P.S. - When that is set to console the compiler looks for main as the entry point, when set to windows it looks for WinMain.