🎉 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
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
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
~~~~~~~~~~
Martee
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.
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.
You need to put WINAPI (or _stdcall, or PASCAL, or APIENTRY, etc.)before WinMain. It should look something like this:
~~~~~~~~~~
Martee
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)
~~~~~~~~~~
Martee
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 Upton
Lead Designer
WolfHeart Software
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement