C/C++ bindings


I had some questions regarding C/C++ with panda:

1)How do I write C/C++ modules and bind/wrap them with python and panda?

2)how would I pack these modules using packp3d?

thanks in advanced

  1. You would do this the same way you do any other Python/C++ binding. This is really a Python question, not a Panda question. There are many, many solutions. One common possibility is a tool called SWIG.

  2. This has been requested fairly often. It’s possible, but a bit complicated; you have to compile all of your C++ code into a separate “package”, using the ppackage tool, and build your p3d file to depend on this package (or install it at runtime).


Well i use boost.python (here are some example snippets: spieleprogrammierer.de/index … tID=185452 dont care about the text its just some smalltalk). The trick is to compile the code as a special dll name it how_ever.pyd so python can load it and pack your app. In most cases the pyd will packed correctly. If you use windows+ visual studio you may call the ppackage stuff from the msvc commandline.

What about Interrogate?

You can certainly use interrogate, too, but there is less documentation about it than these other tools, and it’s kind of fiddly for a newcomer to learn. It’s powerful and efficient, though.

There are literally dozens of options. There is no one right answer for all situations.


Thanks for the replies. I think I’ll look into swig