winmain help 
Author Message
 winmain help

I wrote the following code for microsoft Visual C++ 6.0, but I get the
error(listed below).  How do I fix this?  is this wrong code?  Is the
book I am using wrong?

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
 int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hprevInstance, LPSTR

lpCmdLine, int nShowCmd)
 {
MessageBox(NULL,"\tHello, world!","moo",NULL);
return 0;
 }

--------------------Configuration: Cpp3 - Win32
Debug--------------------
Compiling...
Cpp3.cpp
d:\programming\cpp3.cpp(4) : warning C4007: 'WinMain' : must be
'__stdcall'
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Cpp3.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Cpp3.exe - 2 error(s), 1 warning(s)



Thu, 17 Feb 2005 06:44:10 GMT  
 winmain help
NM, i figured it out.  i was opening a win32 console project instead of a
win32 application.
bleh
Quote:

> I wrote the following code for microsoft visual c++ 6.0, but I get the
> error(listed below).  How do I fix this?  is this wrong code?  Is the
> book I am using wrong?

> #define WIN32_LEAN_AND_MEAN
> #include <windows.h>
>  int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hprevInstance, LPSTR

> lpCmdLine, int nShowCmd)
>  {
> MessageBox(NULL,"\tHello, world!","moo",NULL);
> return 0;
>  }

> --------------------Configuration: Cpp3 - Win32
> Debug--------------------
> Compiling...
> Cpp3.cpp
> d:\programming\cpp3.cpp(4) : warning C4007: 'WinMain' : must be
> '__stdcall'
> Linking...
> LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
> Debug/Cpp3.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.

> Cpp3.exe - 2 error(s), 1 warning(s)



Thu, 17 Feb 2005 07:14:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. APIENTRY WINMAIN and WINAPI WINMAIN

2. Help on WinMain PLEASE!

3. Help using WinMain() with NMAKE

4. Help using NMAKE with WinMain()

5. Help using WinMain() with NMAKE

6. Help using WinMain() with NMAKE

7. WinMain function?

8. WinMain /CLR

9. WinMain() not working everytime?

10. ATL WinMain

11. Replacing WinMain

12. WinMain(HINSTANCE hangup?

 

 
Powered by phpBB® Forum Software