I have found a serious issue while trying to run the “hello world” application using C++ under Ubuntu Karmic Koala.
I have done the following:
First, I have installed the required .deb package for Ubuntu Karmic.
Then, I have created a file named “demo.cxx” with the following code:
#include "pandaFramework.h"
#include "pandaSystem.h"
PandaFramework framework;
int main(int argc, char *argv[]) {
//open a new window framework
framework.open_framework(argc, argv);
//set the window title to My Panda3D Window
framework.set_window_title("My Panda3D Window");
//open the window
WindowFramework *window = framework.open_window();
//here is room for your own code
//do the main loop, equal to run() in python
framework.main_loop();
//close the window framework
framework.close_framework();
return (0);
}
I have tried to compile this code using the following sentence in the command line:
(I have checked it and the required libraries are there.)
However, after running this I get the following error:
demo.cxx:1:28: error: pandaFramework.h: No such file or directory
demo.cxx:2:25: error: pandaSystem.h: No such file or directory
demo.cxx:4: error: ‘PandaFramework’ does not name a type
demo.cxx: In function ‘int main(int, char**)’:
demo.cxx:8: error: ‘framework’ was not declared in this scope
demo.cxx:12: error: ‘WindowFramework’ was not declared in this scope
demo.cxx:12: error: ‘window’ was not declared in this scope
But this creates a even longer error list. I’m copying below just a few of the first lines:
In file included from /usr/include/panda3d/cycleData.h:19,
from /usr/include/panda3d/pandaNode.h:20,
from /usr/include/panda3d/nodePath.h:20,
from /usr/include/panda3d/windowFramework.h:19,
from /usr/include/panda3d/pandaFramework.h:20,
from demo.cxx:1:
/usr/include/panda3d/typeHandle.h:69:20: error: Python.h: No existe el fichero ó directorio
In file included from /usr/include/panda3d/cycleData.h:19,
from /usr/include/panda3d/pandaNode.h:20,
from /usr/include/panda3d/nodePath.h:20,
from /usr/include/panda3d/windowFramework.h:19,
from /usr/include/panda3d/pandaFramework.h:20,
from demo.cxx:1:
/usr/include/panda3d/typeHandle.h:106: error: ISO C++ forbids declaration of ‘PyObject’ with no type
/usr/include/panda3d/typeHandle.h:106: error: expected ‘;’ before ‘*’ token
In file included from /usr/include/panda3d/dSearchPath.h:20,
from /usr/include/panda3d/configPageManager.h:20,
from /usr/include/panda3d/configVariableCore.h:20,
from /usr/include/panda3d/configVariableBase.h:20,
from /usr/include/panda3d/configVariable.h:19,
from /usr/include/panda3d/configVariableEnum.h:19,
from /usr/include/panda3d/notifyCategory.h:21,
from /usr/include/panda3d/notifyCategoryProxy.h:20,
from /usr/include/panda3d/config_express.h:19,
from /usr/include/panda3d/referenceCount.h:23,
from /usr/include/panda3d/nodeReferenceCount.h:20,
from /usr/include/panda3d/cycleData.h:20,
from /usr/include/panda3d/pandaNode.h:20,
from /usr/include/panda3d/nodePath.h:20,
from /usr/include/panda3d/windowFramework.h:19,
from /usr/include/panda3d/pandaFramework.h:20,
from demo.cxx:1:
/usr/include/panda3d/filename.h:70: error: ISO C++ forbids declaration of ‘PyObject’ with no type
I think that the issue it is caused because of python-dev not being installed but, since Ubuntu has Python installed by default and this package is not available in Synaptic, I can not imagine how to fix it.