Panda3D Manual: How to compile a C++ Panda3D program on Linux
<<prev | top | next>> |
This short guide explains how to build a Panda3D game written in C++ game under Linux. If you use Python for programming, you can skip this page. First of all, download the following files: Python, the development package The GNU G++ compiler. On most Linux versions, this is already pre-installed. Now, first of all, we need to create a .o file from our cxx file. We need to link to the Panda3D include files and to the Python include files. Please change the paths in these commands to the appropiate locations.
    g++ -c filename.cxx -o filename.o -fPIC -O2 -I{pythoninclude} -I{panda3dinclude}
To generate an executable, you can use the following command:
    g++ filename.o -o filename -fPIC -L{panda3dlibs} -lp3framework -lpanda
         -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lp3direct
Note: In this two commands, you need to change a few paths: {pythoninclude}: The path to your Python include folder. For version 2.4, this is /usr/include/python2.4 by default. {panda3dinclude}: Change this to the path to your Panda3D include directory. This would probably look like /usr/include/panda3d/. {panda3dlibs}: Change this to the path to your Panda3D libraries. Usually this is just /usr/lib/panda3d or sometimes /usr/lib. To run your newly created executable, type:
    ./filename
If it runs, congratulations! You have successfully compiled your own Panda3D program!
<<prev | top | next>> |