error message while building win32 project

  • Thread starter Thread starter ehabaziz2001
  • Start date Start date
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 ;
}
 
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
 
Back
Top