A Panda3D "Hello World" - Starting Panda3D - probl

I’ve attempted to compile the Starting Panda3D program, but I get the following errors:

nodepath.i(2281) : error C2065: ‘Py_None’ : undeclared identifier
nodepath.i(2281) : error C3861: ‘Py_INCREF’: identifier not found
nodepath.i(2282) : error C2065: ‘Py_None’ : undeclared identifier
asynctask.i(248) : error C3861: ‘Py_XINCREF’: identifier not found
asynctask.i(249) : error C3861: ‘Py_XDECREF’: identifier not found
asynctask.i(265) : error C3861: ‘Py_XINCREF’: identifier not found
asynctask.i(268) : error C2065: ‘Py_None’ : undeclared identifier
asynctask.i(268) : error C3861: ‘Py_INCREF’: identifier not found
asynctask.i(269) : error C2065: ‘Py_None’ : undeclared identifier

Here’s what I’m using and what I’ve done so far:

  • C++ in Microsoft Visual Studio 2008

  • Installed the Microsoft SDK, DirectX SDK and Panda3D.

  • The project was created on a USB

  • I copied the include directory into the same location as the header and source files).

  • I changed:

#include “pandaFramework.h”
#include “pandaSystem.h”

to:

#include “include/pandaFramework.h”
#include “include/pandaSystem.h”

and

#include <Python.h>

to

#include “Python.h”

I don’t know Python (and don’t have the time at the moment), only C++. What should I do?

All I can reccomend is to learn python. If you know C++ it’ll be very easy for you(cuz tahtz eazierh tenah ceepluspluz)

Add panda3d\python\include to the compiler’s include paths.
It is all explained on this page:
panda3d.org/manual/index.php/H … tudio_2008

Thanks for your help :slight_smile: I followed the steps and I don’t get the compile errors anymore. However, when I run the program, I get a debug error:

"This application has requested the runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.

(Please try to re-debug the application)"

What should I do?

Update:

Not sure why, but now I get a different error:

Unhandled exception at 0x76e642eb in Panda3D Tute01.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0016f108…

Try a Release build instead of Debug.

Tried it, but I get the same error

Hm… wait a minute, I think I changed it from debug to release in the wrong area. I’m now changing it in:

Build->Configuration Manager->Active Solution Configuration->Release

Although now I get link errors;

1>Linking…
1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: __thiscall BitMask<unsigned int,32>::~BitMask<unsigned int,32>(void)” (_imp??1?$BitMask@I$0CA@@@QAE@XZ)

1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: static class BitMask<unsigned int,32> __cdecl BitMask<unsigned int,32>::bit(int)” (_imp?bit@?$BitMask@I$0CA@@@SA?AV1@H@Z)

1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: static class BitMask<unsigned int,32> __cdecl BitMask<unsigned int,32>::lower_on(int)” (_imp?lower_on@?$BitMask@I$0CA@@@SA?AV1@H@Z)

1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: void __thiscall PandaFramework::main_loop(void)” (_imp?main_loop@PandaFramework@@QAEXXZ)

1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: class WindowFramework * __thiscall PandaFramework::open_window(void)” (_imp?open_window@PandaFramework@@QAEPAVWindowFramework@@XZ)

1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: void __thiscall PandaFramework::close_framework(void)” (_imp?close_framework@PandaFramework@@QAEXXZ)

1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: void __thiscall PandaFramework::open_framework(int &,char * * &)” (_imp?open_framework@PandaFramework@@QAEXAAHAAPAPAD@Z)

1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: virtual __thiscall PandaFramework::~PandaFramework(void)” (_imp??1PandaFramework@@UAE@XZ)

1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: __thiscall PandaFramework::PandaFramework(void)” (_imp??0PandaFramework@@QAE@XZ)

1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: void __thiscall PandaFramework::set_window_title(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (_imp?set_window_title@PandaFramework@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

1>Panda3D Tute01.obj : error LNK2001: unresolved external symbol “__declspec(dllimport) public: __thiscall TypeHandle::TypeHandle(void)” (_imp??0TypeHandle@@QAE@XZ)

Seems like you’re missing some libs in the link line.

David

It works! IT WORKS!!! HOORAY!

Thanks everyone for all your help, I greatly appreciate it :slight_smile:

Just so other people don’t make the same mistakes I do;

In “Panda3D Manual: How to build a CXX Panda3D game using Microsoft Visual Studio 2008”

BEFORE you add in the .lib files go to:
Build->Configuration Manager

and under: Active Solution Configuration
Change it to: Release

(Don’t go to project and change it to release there, it won’t make a difference)

What this does if if you had added the lib files in debug mode, they will DISAPPEAR! So you must add them again by right clicking project
(E.g. Panda3D Tute01 or whatever your program is called) go to Configuration Properties - > Linker - > Input
and in Additional Dependencies, click on the box with 3 dots in it to the right. Copy paste the .lib files into here (they don’t have to be on the same line and DON’T separate them via semi-colons or anything else).