error message while building win32 project

E

ehabaziz2001

First time for writing the program it goes well but when rebuilding it
issueing that message :

Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/hellomsg.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

hellomsg.exe - 2 error(s), 0 warning(s)

Source Code :

#include <windows.h>

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
MessageBox (NULL, TEXT ("Hello, Ya Gamaha this my first Windows
XP! Program\n Shout Halliolia Maborouk \n Ya happy "), TEXT ("From Ehab
Samir Aziz a Hello Message"), 0) ;

return 0 ;
}
 
V

Victor Bazarov

First time for writing the program it goes well but when rebuilding it
issueing that message :

Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/hellomsg.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Make sure your linker command line has /SUBSYSTEM:windows and not
/SUBSYSTEM:console in it.
hellomsg.exe - 2 error(s), 0 warning(s)

Source Code :

#include <windows.h>

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
MessageBox (NULL, TEXT ("Hello, Ya Gamaha this my first Windows
XP! Program\n Shout Halliolia Maborouk \n Ya happy "), TEXT ("From Ehab
Samir Aziz a Hello Message"), 0) ;

return 0 ;
}

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top