I’m trying to get to know Panda’s C++ API by working through the manual and maybe playing around with some small programs. I stumble over the first lines of code though …
When trying to compile the basic app as shown in the manual http://www.panda3d.org/manual/index.php/Starting_Panda3D I get so many errors that I do doubt my Panda 3D version is installed propperly. Since my programs work just fine with python I must have set something up quite wrong.
Did I use the wrong include paths so the wrong files get included resulting in confusion ? If so which are the correct ones ? All I did was include “%PandaPath%/include” and “%PandaPath%/include/parser-inc”.
Well I included that direcoty because the compiler was looking for Python.h and I didnt know any better then to search for it in Panda’s sources, found it there and included it. From what place shall I pull that one in then ?
Edit:
Nevermind me … I didn’t see I had to set -I%PANDADIR%/python/include as well … Wouldn’t hurt to mention that though. I wonder, since the include directive says
#include <Python.h>
shouldn’t those paths, meaning
%PANDADIR%/include and
%PANDADIR%/python/include
be set as additional system include paths by Panda’s installer ?
Edit2:
Well, I got it compiled now but the linker wishes to find python25.lib which it of course cannot find w/o pointing him the directions. There is such a file in
%PANDADIR/python/libs
but if I point him there I get 4 pretty ugly looking error messages about unresolved external symbols. Looks like some lib link is missing that I do not know of. Did I miss some Tutorial on doing this ? I can’t find any hints about setting this up in the manual or am I blind ?
The program itself is running now (only gray empty screen) but once I try to close it, it crashes. I tracked down the problem to
framework.close_framework();
which will result in
Unhandled exception at 0x00c0fba7 in TestProject C++ with PhysX.exe: 0xC0000005: Access violation writing location 0x0000000a.
Since I am doing nothing but opening the window, running the (empty) main loop and then closing it again, I can’t see a reason as to why it is crashing.
Unhandled exception at 0x004ca6ac in Simulation.exe: 0xC0000005: Access violation writing location 0x000fffff.
upon closing. The exception occurs when returning from main.
Edit:
The problem appears to be with
PandaFramework framework;
since it by itself (meaning no other code active) will generate the exception. I was guessing the runtime wants to see it destroyed before terminating the application, since it is/might be considered an unmanaged application, but the destructor for that class is virtual …