I’m trying to compile the hello world example in VS2008.
I read through the tutorial (and added the libraries, etc.).
When I try to compile I get the following error:
Error 23 error LNK2001: unresolved external symbol _WinMain@16 MSVCRT.lib
I searched on the forums for something similar and couldn’t find such an issue.
How can I get past this?
Better yet: Where can I download a sample project in C++ (preferebly undre vs2008)?
In other words, change your project to use the Console subsystem rather than the Windows subsystem. (Or create a WinMain function rather than a main function.)
Oh.
I was sure it should be a windows app.
Thanks.
btw - I have 22 warnings.
some of this nature:
Warning 8 warning C4996: ‘gmtime’: This function or variable may be unsafe. Consider using gmtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. c:\panda3d-1.6.2\include\time_clock.h 195
and the rest of this nature:
Warning 22 warning C4275: non dll-interface class ‘std::_Container_base_aux’ used as base for dll-interface class ‘std::_Container_base_aux_alloc_real<_Alloc>’ C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector 439
You can set your application to use the Windows subsystem, but that will make you unable to receive command-line output, and will require you to create a WinMain entry point instead of main.
Thanks for the answers.
That really cleared up my block and got me started.
Just one thing: How can I change the project to windows?
Just changing the subsystem and main to winmain still has the same error i got at the beginning.
Aside from command line arguments, btw, is there a reason to run in a console environment?
Er, you should probably keep it a console project. Otherwise you won’t have console output, and without it it becomes very hard to develop your application.
That way you can always use a main() entry point rather than a WinMain(). It also allows you to switch subsystems by setting the define CONSOLE rather than changing the property pages.
And Panda will create a window for you regardless of the subsystem, but as rdb said, it’s convenient to have a console for development because you’ll be able to read Panda debugging messages, assertions, etc.
Actually, those aren’t the same errors at all. The OP had an error message about a missing function called WinMain. Your missing functions are all Panda functions; there is no mention of WinMain.
It looks like you haven’t added the Panda libraries to your project.
That does look like the right set of libraries, but something is still missing. What version of MSVS are you running? Also, what is the very first error message displayed?
I’m not suggesting this will solve your problem (it may) but it may be a better starting ground, I’ve always had more luck with 1.7.0 in C++, plus that way we are using the same and I can help you better.
After adding all these directories, right click on project and select properties. In the menu that comes up select the Linker and then the Input tab. In the Additional Dependencies row add the following libraries: