setting up panda 3d in visual studio 2008 issues

hello, I followed this guide to set up visual studio 2008 sp1 with panda 3d:
panda3d.org/manual/index.php … tudio_2008

and I get some weird errors when compiling, I did the extra work to include third party tools, but i have not done the Ndebug thing that everyone is talking about since I only find ppl asking: Did you try the Ndebug thing?, And never anyone explaining how to actually do the Ndebug thing.

Anyway, here is the code:

#include <pandaFramework.h>
#include <pandaSystem.h>

int main(int argc, char *argv[]) {
//open a new window framework
framework.open_framework(argc, argv);
//set the window title to My Panda3D Window
framework.set_window_title(“My Panda3D Window”);
//open the window
WindowFramework *window = framework.open_window();

//here is room for your own code

//do the main loop, equal to run() in python
framework.main_loop();
//close the window framework
framework.close_framework();
return (0);
}

And, here are the errors:

1>c:\Program Files (x86)\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>’
1> with
1> [
1> _Alloc=pallocator_arraystd::string
1> ]
1> c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of ‘std::_Container_base_aux’
1> c:\panda3d-1.7.2\include\vector_src.h(64) : see reference to class template instantiation ‘std::vector<_Ty,_Ax>’ being compiled
1> with
1> [
1> _Ty=std::string,
1> _Ax=pallocator_arraystd::string
1> ]
1>c:\Program Files (x86)\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>’
1> with
1> [
1> _Alloc=pallocator_array<TypedWritable *>
1> ]
1> c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of ‘std::_Container_base_aux’
1> c:\panda3d-1.7.2\include\vector_src.h(64) : see reference to class template instantiation ‘std::vector<_Ty,_Ax>’ being compiled
1> with
1> [
1> _Ty=TypedWritable *,
1> _Ax=pallocator_array<TypedWritable *>
1> ]
1>c:\Program Files (x86)\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>’
1> with
1> [
1> _Alloc=pallocator_array
1> ]
1> c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of ‘std::_Container_base_aux’
1> c:\panda3d-1.7.2\include\vector_src.h(64) : see reference to class template instantiation ‘std::vector<_Ty,_Ax>’ being compiled
1> with
1> [
1> _Ty=int,
1> _Ax=pallocator_array
1> ]
1>c:\Program Files (x86)\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>’
1> with
1> [
1> _Alloc=pallocator_array
1> ]
1> c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of ‘std::_Container_base_aux’
1> c:\panda3d-1.7.2\include\vector_src.h(64) : see reference to class template instantiation ‘std::vector<_Ty,_Ax>’ being compiled
1> with
1> [
1> _Ty=unsigned char,
1> _Ax=pallocator_array
1> ]
1>c:\Program Files (x86)\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>’
1> with
1> [
1> _Alloc=pallocator_array
1> ]
1> c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of ‘std::_Container_base_aux’
1> c:\panda3d-1.7.2\include\vector_src.h(64) : see reference to class template instantiation ‘std::vector<_Ty,_Ax>’ being compiled
1> with
1> [
1> _Ty=GraphicsWindowInputDevice,
1> _Ax=pallocator_array
1> ]
1>.\main.cpp(6) : error C2065: ‘framework’ : undeclared identifier
1>.\main.cpp(6) : error C2228: left of ‘.open_framework’ must have class/struct/union
1> type is ‘‘unknown-type’’
1>.\main.cpp(8) : error C2065: ‘framework’ : undeclared identifier
1>.\main.cpp(8) : error C2228: left of ‘.set_window_title’ must have class/struct/union
1> type is ‘‘unknown-type’’
1>.\main.cpp(10) : error C2065: ‘framework’ : undeclared identifier
1>.\main.cpp(10) : error C2228: left of ‘.open_window’ must have class/struct/union
1> type is ‘‘unknown-type’’
1>.\main.cpp(15) : error C2065: ‘framework’ : undeclared identifier
1>.\main.cpp(15) : error C2228: left of ‘.main_loop’ must have class/struct/union
1> type is ‘‘unknown-type’’
1>.\main.cpp(17) : error C2065: ‘framework’ : undeclared identifier
1>.\main.cpp(17) : error C2228: left of ‘.close_framework’ must have class/struct/union

I currently have pandaFramework.h and pandaSystem.h included as headers into my project…

You forgot to instantiate a framework, like this:

PandaFramework framework;

thx alot for the help, although it still generates errors:

1>.\main.cpp(4) : error C2146: syntax error : missing ‘;’ before identifier ‘framework’
1>.\main.cpp(4) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\main.cpp(4) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\main.cpp(8) : error C2228: left of ‘.open_framework’ must have class/struct/union
1> type is ‘int’
1>.\main.cpp(10) : error C2228: left of ‘.set_window_title’ must have class/struct/union
1> type is ‘int’
1>.\main.cpp(12) : error C2228: left of ‘.open_window’ must have class/struct/union
1> type is ‘int’
1>.\main.cpp(17) : error C2228: left of ‘.main_loop’ must have class/struct/union
1> type is ‘int’
1>.\main.cpp(19) : error C2228: left of ‘.close_framework’ must have class/struct/union
1> type is ‘int’

I edited the code to look like this:
#include <pandaFramework.h>
#include <pandaSystem.h>

Panda3D_Framework framework; //NEW LINE HERE - My project is called Panda3D_Framework

int main(int argc, char *argv[]) {
//open a new window framework
framework.open_framework(argc, argv);
//set the window title to My Panda3D Window
framework.set_window_title(“My Panda3D Window”);
//open the window
WindowFramework *window = framework.open_window();

//here is room for your own code

//do the main loop, equal to run() in python
framework.main_loop();
//close the window framework
framework.close_framework();
return (0);
}

You must have misread my message:

PandaFramework framework;

PandaFramework is the correct name of the class that you are instantiating.

Yay thanks alot :smiley:. Now its just some linker errors left, i think i can solve them myself, if not ill be back^^.

Alright, i’m stuck again. Had to add additional include directories to get most of the .lib includes to work.

But the python includes are in another folder so I don’t know how to make visual studio understand where to find them. (In fact I think I have done that below but it does not work…).

The error message i’m working to solve:
1>LINK : fatal error LNK1104: cannot open file ‘python26.lib’

What I currently have written in additional include directories (in project properties -> C++ -> General):
“C:\Panda3D-1.7.2\python\include”;“C:\Panda3D-1.7.2\include”

This is not the C++ include path, but the linker include path. You will find this in a different place in your project settings. You need to make sure that the folder that includes python26.lib is on your linker path.

David

Ohhh, I found it. in the python folder i have both a folder called Lib and one called libs, I had linked to the wrong one, one seems to be for c++ and the other for python :slight_smile:.