Warnings

I’m new to Panda3D but am excited about the possibilities, after having used Irrlicht and tried and failed to use Ogre (too complex, in my opinion).

I have followed the helpful manual as well as I could but two things came up. First, the manual doesn’t specify what type of project to start.
http://www.panda3d.org/manual/index.php/How_to_build_a_CXX_Panda3D_game_using_Microsoft_Visual_Studio_2008
Is it supposed to be a Win32 Console Application or a Win32 Project or something else?

Second, after trying to use Win32 Console Application, setting the project to Release, removing NDEBUG and adding the libraries, I get a ton of warnings on trying to compile. There are actually no errors and the examples run fine (which was really nice to see) but here are some of the warnings:

1>d:\programming\panda3d-1.6.2\include\stl_compares.I(135) : warning C4311: 'reinterpret_cast' : pointer truncation from 'const void *' to 'unsigned long'
1>d:\programming\panda3d-1.6.2\include\configPageManager.I(71) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>d:\programming\panda3d-1.6.2\include\configPageManager.I(96) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>d:\programming\panda3d-1.6.2\include\configPageManager.I(123) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>d:\programming\panda3d-1.6.2\include\configPageManager.I(149) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>d:\programming\panda3d-1.6.2\include\configPageManager.I(175) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>d:\programming\panda3d-1.6.2\include\configVariableCore.I(172) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>d:\programming\panda3d-1.6.2\include\configVariableCore.I(203) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>d:\programming\panda3d-1.6.2\include\configVariableCore.I(236) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>d:\programming\panda3d-1.6.2\include\configDeclaration.I(94) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
1>d:\programming\panda3d-1.6.2\include\configVariableManager.I(24) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data

There are a lot more of these conversion warnings. Then…

1>d:\programming\panda3d-1.6.2\python\include\pyconfig.h(51) : warning C4005: 'HAVE_IO_H' : macro redefinition
1>        d:\programming\panda3d-1.6.2\include\dtool_config.h(56) : see previous definition of 'HAVE_IO_H'
1>d:\programming\panda3d-1.6.2\include\checksumHashGenerator.I(71) : warning C4311: 'type cast' : pointer truncation from 'void *' to 'long'
1>d:\programming\panda3d-1.6.2\include\time_span.h(378) : warning C4996: 'sprintf' was declared deprecated
1>        D:\Programming\Microsoft Visual Studio 8\VC\include\stdio.h(345) : see declaration of 'sprintf'
1>        Message: 'This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'

And some other warnings. Any guess as to what I may have done wrong? I’m using Visual Studio 2005.

Thank you for any help.

I don’t think it matters that much what type of project you choose - although it’s probably wise to make it a Win32 Console Application.

Those warnings are not important. You can ignore them (I think the compiler has an option somewhere to ignore certain warnings)

Warnings are normal. I have set my project to ignore certain warnings actually, I have “4275;4996;4005” in C++/Advanced/Ignore specific warnings for example. But you could be getting different warnings. Just hide them or ignore them, as long as it builds you shouldn’t worry about them, all big c++ projects produce warnings like that. For example, sometimes you want to fit an int into a char, and you know that the int fits because its a low number, but the compiler doesn’t know, so it tells you that you may be losing some data. I’m using visual studio 2008 SP1, btw.

About the type of project, I like to setup an empty win32 application, then I set the subsystem in my code, like this:

#ifdef CONSOLE
#pragma comment(linker, "/subsystem:console /ENTRY:mainCRTStartup")
#else 
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif

So I just define CONSOLE when I want the console, the mainCRTStartup thing is for being able to use a main() entry point, that way I can have the same entry point on misc platforms.

Thank you both. I’ll ignore the warnings. Gogg, your console code is appreciated as well.