Win32 Console aplication

hey guys,

i would like to ask a question to you all. When i set up the win32 console application well any console application the area where the default code sheet would be is not there. When i first set up Panda i did it in a empty project it gave me the default .cpp but the console one doesn’t so i am not sure what to do. Seeing as after look thought the forums i found out you have to set up a Console application if your going to make a game. seeing as this is my first time using Vs2010 so i am clueless. i mean i got it to build successfully in an empty project but it would just crash after i started the exe
saying [program name] has encounter a problem and needs to close, so i was wondering how i would go about doing this for win32 cpp pretty much. I have already set up all the directories.

I fixed that problem that i ahd in my first post but now the .exe is still doing this

Blitz.exe must close right now we are sorry for the inconvenience.

this problem is even shown in a demo i download it was a pandaAI demo and it start up then closed itself
giving me a error comment in the command prompt window

don’t know why it is doing this. :angry:

Can you post the following?

  • your full code
  • version of Panda you are using
  • version of visual studio
  • paste the error message or screenshot if it’s in a dialog box and you can’t copy

-Panda 1.7.0

  • Visual Studio 2010
  • I use the code in the manual:
// Include all the stuff
#include "pandaFramework.h"
#include "pandaSystem.h"

// Init the PandaFramework class
PandaFramework framework;
int main(int argc, char *argv[]) { 
 // Open the framework  
framework.open_framework(argc, argv); 
 // Set a nice title  
framework.set_window_title("Hello World!");  
// Open it!  
WindowFramework *window = framework.open_window();   

// Check whether the window is loaded correctly  
if (window != (WindowFramework *)NULL) {   
 nout << "Opened the window successfully!\n";     

window->enable_keyboard(); //  Enable keyboard detection    
window->setup_trackball(); // Enable default camera movement     

// Put here your own code, such as the loading of your models     

// Do the main loop    
framework.main_loop();  
} else {    
nout << "Could not load the window!\n";  
}  

// Close the framework  
framework.close_framework();  
return (0);
}

this is the error i get is not even a report form Visual sttudio becaue it built sucessfully

When i click Start without debugging
the windows load then i get
Sorry but [your progam name] .exe has encountered an problem is needs to close we are sory for the inconvience.

Yeah, visual studio 2010 is the problem. If you are using the official distribution, you are using panda libraries built with VS-2008, Service Pack 1, so you should use that.

If you need to use visual studio 2010 then you just have to build panda from source, problem is you may have to build some dependencies from source too, things like ffmpeg, libjpeg, libpng, etc.

Summing up, just use VS 2008.

Hmm but why does Visual Studio 2010 not work? just curious to know.

I will try Visual Studio 2008 lets pray it works 8)

Because Microsoft keeps changing the C++ ABI between VS2005, VS2008, VS2009, and VS2010. This means that C++ apps compiled with one version of the compiler aren’t compatible with C++ libraries compiled with another version. Not only does it not work if you try to mix-and-match, but it fails in mysterious ways.

Take it up with Microsoft.

David

Don’t forget to install the Service Pack 1 for VS 2008. Bare 2008 is also incompatible with 2008-SP1, and SP1 is what was used to build panda and its dependencies.

ohhh ok David i was wondering have you filed bug report for Microsoft visual studio cause if you have i think i saw some of your bug report. Small world

No, it’s not a bug; it’s just a (poor) design decision on Microsoft’s part.

Sorry i meant like bugs in general cause also Should i install Visual basic 2008 or Visual C++ 2008

just to make sure don;t want to assume and be wrong

You need Visual C++ 2008. You don’t need Visual Basic.

David

Thanks Gogg & David i am installing it right as we speak and i report asap if there is any problems lets hope not

After i did it i got this error

------ Build started: Project: Practise, Configuration: Release Win32 ------
Compiling...
Panda_Practise.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
        with
        [
            _Alloc=pallocator_array<std::string>
        ]
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
        c:\panda3d-1.7.0\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
        with
        [
            _Ty=std::string,
            _Ax=pallocator_array<std::string>
        ]
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
        with
        [
            _Alloc=pallocator_array<TypedWritable *>
        ]
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
        c:\panda3d-1.7.0\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
        with
        [
            _Ty=TypedWritable *,
            _Ax=pallocator_array<TypedWritable *>
        ]
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
        with
        [
            _Alloc=pallocator_array<int>
        ]
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
        c:\panda3d-1.7.0\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
        with
        [
            _Ty=int,
            _Ax=pallocator_array<int>
        ]
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
        with
        [
            _Alloc=pallocator_array<unsigned char>
        ]
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
        c:\panda3d-1.7.0\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
        with
        [
            _Ty=unsigned char,
            _Ax=pallocator_array<unsigned char>
        ]
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
        with
        [
            _Alloc=pallocator_array<GraphicsWindowInputDevice>
        ]
        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
        c:\panda3d-1.7.0\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
        with
        [
            _Ty=GraphicsWindowInputDevice,
            _Ax=pallocator_array<GraphicsWindowInputDevice>
        ]
Linking...
Generating code
Finished generating code
Embedding manifest...
Project : error PRJ0003 : Error spawning 'cmd.exe'.
Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Practise\Practise\Release\BuildLog.htm"
Practise - 1 error(s), 5 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Sounds like your environment is messed up.

Did you restart after installing visual studio 2008?

Also check this post and see if the circumstances described fit yours:

interact-sw.co.uk/iangblog/2 … spawnerror

About the warnings, ignore them, you can set your project so that it won’t appear again by telling vs to specifically ignore the error C4275 (in this case) in c++/advanced

hmm i did what he told me to do but i never got the error when i checked my VC++Directories

Also after restarted the other problems disappear only problem i have is;

Project : error PRJ0003 : Error spawning ‘cmd.exe’.

Well it appears that they were not on the list so i added

$(SystemRoot)
   $(SystemRoot)\System32
   $(SystemRoot)\System32\wbem

in the Executable windows

I then click start without debugging

and I was given the error again but htis time i ingnored iwhich i didn’t do before and i have never buildt it succesfully before but it worked :smiley: stil have the error though hmm :confused:

hmm i also have

$(SystemRoot)\SysWow64

should be having that?

Problem is if i do that Gogg then i get a error about invalid argument for C4275