making a dll with panda without panda source

I have been working on this system that is based upon makepanda that will compile c++ source with interrogate without compiling the entire panda engine or requires futzing around with command options. This is basically me gutting makepanda to do this, and as a result, the code is not the best organized, but it appears to work.

I have only tested it on windows xp with panda 1.5.4, it will probably die with 1.6.x but might have some chance of working on linux (in theory…)

the makelib is meant to go in the panda install directory. simply provide it with the input files/directory and the output name and it will build your module.

This is slightly experimental at the moment…I have not tested it on anything but my machine. You will need visual studio to compile on windows.

please read the readme for options.

mindstormss.googlepages.com/makelib

This is cool. Its odd i missed it. So this would allow use to write our own custom C++ scriplets and compile them into dll/os with ease? It still will require all the include/libs stuff?

I tried it with Panda 1.6.1, and it works. It works REALLY well.

I had been looking for a tool like this for a long time. I’ve used ctypes and SWIG in the past, but if I needed access to the Panda libraries, I could never figure out how to get interrogate working.

Thanks for this tool, mindstormss.

If you’re looking for additional features to implement, you should allow the user to specify an output diectory. It would copy the DLL there and rename it as a PYD. I got around this by writing a batch file that runs makelib and then does this:

copy makelib\result\test.dll \MyProject\test.pyd

But if you want the tool to be more user-friendly, it should be an option.

Thanks again!

I’m glad that people are interested…

Sorry, I have been in the middle of moving over to a new computer and graduating, but in a week or so I should have all the time in the world to add/subtract/fix.

If you are interested, everything is in the makelib.py and makelibcore.py. Please do give me any bugs.

Yes, the idea behind this is that you write a c++ lib using panda and then feed the directory to makelib and it will build a dll.

An interesting point:
the resulting dll does not need panda at all and could potentially be used to convert non-panda things to python. Haven’t tested past a small lib, but it is doeable: use panda build system to build non panda things. It does seem rather universal.