(yet another) Linking problem

Hi,

can somebody please help me figure out how to compile this sample?

#include "pandaFramework.h"
#include "pandaSystem.h"

int main(int argc, char *argv[]) {
    PandaFramework framework;
    framework.open_framework(argc, argv);
    framework.set_window_title("My Panda3D Window");
    WindowFramework *window = framework.open_window();

    framework.main_loop();
    framework.close_framework();

    return (0);
}

(It’s the very first sample in the manual.)

I’m using Panda 1.8 on Ubuntu 12.04 and g++ via NetBeans.

I have set the Include and Lib directories:

-I/usr/include/python2.7
-I/usr/include/python2.7_d
-I/usr/include/panda3d

and am linking what I think are the right files:

-L/usr/lib/python2.7
-L/usr/lib/panda3d

-lp3pystub
-lp3framework
-lpanda
-lp3direct
-lp3dtool
-lp3dtoolconfig

But when I try to compile this, I get a lot of these errors:

/usr/lib/panda3d/libpanda.so: undefined reference to PyObject_Cmp' /usr/lib/panda3d/libpanda.so: undefined reference toPyUnicodeUCS4_FromWideChar’

PyDict_SetItem',PyExc_ValueError’, PyDict_SetItemString',PyType_IsSubtype’, PyString_FromString',PyErr_Fetch’

and so on.

It looks like I need to link a python library but I don’t know which one or where to find it :frowning:

Hope somebody can explain this to me. Thank you very much in advance!

-jan

You need to link to Python by also adding -lpython2.7 to the command line.