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
Feel free to email me at NYYanks432@hotmail.com if you have any questions
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
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.
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:
~~~~~~~~~~
Martee
|
~~~~~~~~~~
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 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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement