🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Visual C++ 6.0 Error Question

Started by
3 comments, last by GameDev135 22 years, 11 months ago
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
Feel free to email me at NYYanks432@hotmail.com if you have any questions
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
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
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.
Feel free to email me at NYYanks432@hotmail.com if you have any questions
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
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
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
WNDCLASSEX Reality;......Reality.lpfnWndProc=ComputerGames;......RegisterClassEx(&Reality);Unable to register Reality...what's wrong?---------Dan Uptonhttp://0to1.orghttp://www20.brinkster.com/draqza

This topic is closed to new replies.

Advertisement