• Advertisement

Archived

This topic is now archived and is closed to further replies.

Visual C++ 6.0 Error Question

This topic is 6038 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I had to brush up on my C++ before I could start doing graphical programming. So I went into Visual C++ 6.0 and started practicing using classes and header files. Suddenly I got this error: LNK2001 unresolved external symbol _winmain@16 I started to wonder what was causing this and went back to the simple HelloWorld program. Now this program was giving me an error too. I found a small way around the problem, but it is very inefficient. (Basically I just make a cpp file to start and then it builds a project instead of the reverse order) I have been through all of the help, etc. and I still dont know how to fix it. Any one have any suggestions? Do you think a file could have somehow become corrupt and I should reinstall? Thanks

Share this post


Link to post
Share on other sites
Advertisement
When you created your project, did you make a Win32 app, or a Win32 console app? If it''s not a console app, you need to use WinMain instead of main.

~~~~~~~~~~
Martee

Share this post


Link to post
Share on other sites
Thanks a lot, I now can do it as a console.

However, when I try to do it as a WinApp, it still gives the same error. Additionally, it has a warning:
"WinMain must be _stdCall"
While this isnt important for a program such as helloworld (I can do that in a windows console), this could be important later. I have changed the "main" to "winmain" (with different combinations of capital letters) and it still gives the unresolved external symbol.

What now? Thanks.

Share this post


Link to post
Share on other sites
You need to put WINAPI (or _stdcall, or PASCAL, or APIENTRY, etc.)before WinMain. It should look something like this:
  
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)


~~~~~~~~~~
Martee

Share this post


Link to post
Share on other sites
Yeah, that should fix it. I''m getting ready to release a 3 part series of tutorials on basic windows programming without using the wizard; I''ll post here when it''s ready.
--


WNDCLASSEX Reality;
...
...
Reality.lpfnWndProc=ComputerGames;
...
...
RegisterClassEx(&Reality);


Unable to register Reality...what''s wrong?
---------
Dan Upton
Lead Designer
WolfHeart Software

Share this post


Link to post
Share on other sites

  • Advertisement