Tutorial Problem/Issue Question

Greetings,

First, I am not sure if this is the right place to post this, so let me apologize for any inconvenience.

Now to the Problem/Question:

I have installed panda on VC2003, and I got my panda window running so all was well, so I began running the tutorials for CXX. I was able to make it up to the animation one. Here is the list:

A Panda “Hello World” using CXX

  1. Starting Panda3D (CXX)
  2. Loading the Grassy Scenery (CXX)
  3. Controlling the Camera (CXX)
  4. Loading and Animating the Panda Model (CXX)

So far I have mange to get it to compile but when I try to run number 5. Using Intervals to move the Panda (CXX) cant compile anymore.

Compile Errors:

TestPanda error LNK2001: unresolved external symbol "protected: virtual void __thiscall CMetaInterval::do_recompute(void)" (?do_recompute@CMetaInterval@@MAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CMetaInterval::write(class std::basic_ostream<char,struct std::char_traits<char> > &,int)const " (?write@CMetaInterval@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@H@Z)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CInterval::output(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?output@CInterval@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CMetaInterval::priv_interrupt(void)" (?priv_interrupt@CMetaInterval@@UAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CMetaInterval::priv_reverse_finalize(void)" (?priv_reverse_finalize@CMetaInterval@@UAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CMetaInterval::priv_reverse_instant(void)" (?priv_reverse_instant@CMetaInterval@@UAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CMetaInterval::priv_reverse_initialize(double)" (?priv_reverse_initialize@CMetaInterval@@UAEXN@Z)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CMetaInterval::priv_finalize(void)" (?priv_finalize@CMetaInterval@@UAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CMetaInterval::priv_step(double)" (?priv_step@CMetaInterval@@UAEXN@Z)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CMetaInterval::priv_instant(void)" (?priv_instant@CMetaInterval@@UAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CMetaInterval::priv_initialize(double)" (?priv_initialize@CMetaInterval@@UAEXN@Z)
TestPanda error LNK2001: unresolved external symbol "public: virtual class TypeHandle __thiscall CMetaInterval::force_init_type(void)" (?force_init_type@CMetaInterval@@UAE?AVTypeHandle@@XZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual class TypeHandle __thiscall CMetaInterval::get_type(void)const " (?get_type@CMetaInterval@@UBE?AVTypeHandle@@XZ)
TestPanda error LNK2001: unresolved external symbol "protected: virtual void __thiscall CInterval::do_recompute(void)" (?do_recompute@CInterval@@MAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CInterval::write(class std::basic_ostream<char,struct std::char_traits<char> > &,int)const " (?write@CInterval@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@H@Z)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CLerpNodePathInterval::output(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?output@CLerpNodePathInterval@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CInterval::priv_interrupt(void)" (?priv_interrupt@CInterval@@UAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CInterval::priv_reverse_finalize(void)" (?priv_reverse_finalize@CInterval@@UAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CLerpNodePathInterval::priv_reverse_instant(void)" (?priv_reverse_instant@CLerpNodePathInterval@@UAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CLerpNodePathInterval::priv_reverse_initialize(double)" (?priv_reverse_initialize@CLerpNodePathInterval@@UAEXN@Z)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CInterval::priv_finalize(void)" (?priv_finalize@CInterval@@UAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CLerpNodePathInterval::priv_step(double)" (?priv_step@CLerpNodePathInterval@@UAEXN@Z)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CLerpNodePathInterval::priv_instant(void)" (?priv_instant@CLerpNodePathInterval@@UAEXXZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual void __thiscall CLerpNodePathInterval::priv_initialize(double)" (?priv_initialize@CLerpNodePathInterval@@UAEXN@Z)
TestPanda error LNK2001: unresolved external symbol "public: virtual class TypeHandle __thiscall CLerpNodePathInterval::force_init_type(void)" (?force_init_type@CLerpNodePathInterval@@UAE?AVTypeHandle@@XZ)
TestPanda error LNK2001: unresolved external symbol "public: virtual class TypeHandle __thiscall CLerpNodePathInterval::get_type(void)const " (?get_type@CLerpNodePathInterval@@UBE?AVTypeHandle@@XZ)
TestPanda error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall CInterval::loop(double,double,double)" (__imp_?loop@CInterval@@QAEXNNN@Z) referenced in function _main
TestPanda error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall CMetaInterval::add_c_interval(class CInterval *,double,enum CMetaInterval::RelativeStart)" (__imp_?add_c_interval@CMetaInterval@@QAEHPAVCInterval@@NW4RelativeStart@1@@Z) referenced in function _main
TestPanda error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CMetaInterval::CMetaInterval(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0CMetaInterval@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
TestPanda error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall CLerpNodePathInterval::set_end_hpr(class LVecBase3f const &)" (__imp_?set_end_hpr@CLerpNodePathInterval@@QAEXABVLVecBase3f@@@Z) referenced in function _main
TestPanda error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall CLerpNodePathInterval::set_start_hpr(class LVecBase3f const &)" (__imp_?set_start_hpr@CLerpNodePathInterval@@QAEXABVLVecBase3f@@@Z) referenced in function _main
TestPanda error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall CLerpNodePathInterval::set_end_pos(class LVecBase3f const &)" (__imp_?set_end_pos@CLerpNodePathInterval@@QAEXABVLVecBase3f@@@Z) referenced in function _main
TestPanda error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall CLerpNodePathInterval::set_start_pos(class LVecBase3f const &)" (__imp_?set_start_pos@CLerpNodePathInterval@@QAEXABVLVecBase3f@@@Z) referenced in function _main
TestPanda error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CLerpNodePathInterval::CLerpNodePathInterval(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,double,enum CLerpInterval::BlendType,bool,bool,class NodePath const &,class NodePath const &)" (__imp_??0CLerpNodePathInterval@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@NW4BlendType@CLerpInterval@@_N2ABVNodePath@@3@Z) referenced in function _main
TestPanda error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CLerpNodePathInterval::~CLerpNodePathInterval(void)" (__imp_??1CLerpNodePathInterval@@UAE@XZ) referenced in function "public: virtual void * __thiscall CLerpNodePathInterval::`scalar deleting destructor'(unsigned int)" (??_GCLerpNodePathInterval@@UAEPAXI@Z)
TestPanda error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CMetaInterval::~CMetaInterval(void)" (__imp_??1CMetaInterval@@UAE@XZ) referenced in function "public: virtual void * __thiscall CMetaInterval::`scalar deleting destructor'(unsigned int)" (??_GCMetaInterval@@UAEPAXI@Z)

So I read some post and changed the runtime library, from single thread to Multi-threaded DLL (/MD). After compilation I get this different set of errors:

c:\Documents and Settings\Max Draco\My Documents\Visual Studio Projects\TestPanda\HelloWorld.cpp(24): error C2556: 'NodePath *__p__environ(void)' : overloaded function differs only by return type from 'char ***__p__environ(void)  '
c:\Documents and Settings\Max Draco\My Documents\Visual Studio Projects\TestPanda\HelloWorld.cpp(24): error C2040: '__p__environ' : 'NodePath *(void)' differs in levels of indirection from 'char ***(void)  '
c:\Documents and Settings\Max Draco\My Documents\Visual Studio Projects\TestPanda\HelloWorld.cpp(24): error C2072: '__p__environ' : initialization of a function

So to recap everything is fine until I try to compile the code of Tutorial 5.

Any help would be great, thanks in advance,

Unfortunately, here’s the situation:

I never wrote a manual on how to use panda in CXX, because I don’t have time to maintain such a thing. It’s easy to write a manual: the challenge is that it becomes a life-long commitment to keep it up-to-date as panda changes. Apparently, somebody went and added the whole CXX tutorial section to the manual, but apparently, they didn’t maintain it. So now we have a bunch of pages which appear to be out-of-date.

Long story short: I’m going to remove the CXX sections from the manual unless somebody promises to stay on top of them.

As for your compile errors: no idea. However, I see you mention VC2003. We compile panda using VC2005. You might want to try that. (It’s a free download).

I see, thanks a lot for the reply. I think the tutorials should be left in the manual, they were very helpful , just add an annotation with the version for which they were compiled.

In case someone runs into the same problem

Error Update:

c:\Documents and Settings\Max Draco\My Documents\Visual Studio Projects\TestPanda\HelloWorld.cpp(24): error C2556: 'NodePath *__p__environ(void)' : overloaded function differs only by return type from 'char ***__p__environ(void)  '
c:\Documents and Settings\Max Draco\My Documents\Visual Studio Projects\TestPanda\HelloWorld.cpp(24): error C2040: '__p__environ' : 'NodePath *(void)' differs in levels of indirection from 'char ***(void)  '
c:\Documents and Settings\Max Draco\My Documents\Visual Studio Projects\TestPanda\HelloWorld.cpp(24): error C2072: '__p__environ' : initialization of a function 

I have managed to fix these errors, apparently the name ‘environ’ is already declared someplace else in Panda3D or my system and it seems it was referring to that. A simple change of names to “environs” finxed to problem.

As for the problem with the CLerpInterval, it is still remains, once the above mentioned error is fixed I go back to having the linker problem.

I found the solution in the following post :
discourse.panda3d.org/viewtopic.php … thinterval

Long story short, needed to include libp3direct.lib in my additional dependencies.

PandaFramework framework;
framework.open_framework(argc, argv);

framework.set_window_title(“xxxx”);
WindowFramework *window = framework.open_window();

// do not use ‘environ’
NodePath environ = window->load_model(framework.get_models(), “environment”); // error C2556, error C2373

// is ok:
NodePath scene = window->load_model(framework.get_models(), “environment”);