I think this is one that was actually answered years ago but I’ve forgotten how to fix it.
I’m compiling Panda (from CVS) on Linux (Kubuntu 12.04 64 bit).
Everything works fine except building maya2egg2011 and maya2egg2012 - there seems to be a linker problem with python.
Here is the error:
[T1] Linking executable built/bin/maya2egg2011
g++ -o built/bin/maya2egg2011 -Lbuilt/lib -Lbuilt/tmp -L/usr/X11R6/lib built/tmp/mayapath2011.o -lp3dtool -lp3dtoolconfig -lpandaexpress -pthread -ldl
built/lib/libpandaexpress.so: undefined reference to `PyExc_ValueError'
built/lib/libpandaexpress.so: undefined reference to `PyString_Size'
built/lib/libp3dtoolconfig.so: undefined reference to `PyObject_Call'
built/lib/libpandaexpress.so: undefined reference to `PyString_AsStringAndSize'
...
many other undefined references follow, all Python ones.
I get the same build errors with maya2egg2012.
Building with --no-maya2011 --no-maya2012 completes with no errors.
Just for the heck of it I tried this:
g++ -o built/bin/maya2egg2012 -Lbuilt/lib -Lbuilt/tmp -L/usr/X11R6/lib built/tmp/mayapath2012.o -lp3dtool -lp3dtoolconfig -lpandaexpress -pthread -ldl -lpython2.7
which completes with no errors.
However, then I got this odd error at runtime:
built/bin/maya2egg2012
MAYA_LOCATION: /usr/autodesk/maya2012-x64
Could not find $MAYA_LOCATION/bin/OpenMaya.so!
well of course not - the correct path is $MAYA_LOCATION/lib/libOpenMaya.so.
As an experiment I changed mayapath.cxx to look there instead:
static const Filename openmaya_filename = "lib/libOpenMaya.so";
that probably breaks Windows, but whatever
Now, using the above g++ incantation, I got a compiled maya2egg2012 that doesn’t have trouble finding libOpenMaya, but unfortunately dies with an invalid pointer crash:
built/bin/maya2egg2012
MAYA_LOCATION: /usr/autodesk/maya2012-x64
*** glibc detected *** built/bin/maya2egg2012: free(): invalid pointer: 0x0000000001289f28 ***
Here’s the stack trace
(gdb) bt
#0 0x00007ffff2bb3445 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff2bb6bab in __GI_abort () at abort.c:91
#2 0x00007ffff2bf0e2e in __libc_message (do_abort=2, fmt=0x7ffff2cf90d0 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:201
#3 0x00007ffff2bfb626 in malloc_printerr (action=3, str=0x7ffff2cf6081 "free(): invalid pointer", ptr=<optimized out>) at malloc.c:5007
#4 0x00007ffff51ab280 in ConfigPageManager::reload_implicit_pages() () from /usr/lib/panda3d/libp3dtoolconfig.so.1.8
#5 0x00007ffff51a9828 in ConfigVariableCore::get_declaration(int) const () from /usr/lib/panda3d/libp3dtoolconfig.so.1.8
#6 0x00007ffff574077f in ConfigVariableBool::get_value() const () from /usr/lib/panda3d/libpandaexpress.so.1.8
#7 0x00007ffff572f053 in MemoryUsage::MemoryUsage(MemoryHook const&) () from /usr/lib/panda3d/libpandaexpress.so.1.8
#8 0x00007ffff572f5d4 in MemoryUsage::get_global_ptr() () from /usr/lib/panda3d/libpandaexpress.so.1.8
#9 0x00007ffff5758a8b in VirtualFileMount::VirtualFileMount() () from /usr/lib/panda3d/libpandaexpress.so.1.8
#10 0x00007ffff5752be7 in VirtualFileSystem::mount(Filename const&, Filename const&, int, std::string const&) () from /usr/lib/panda3d/libpandaexpress.so.1.8
#11 0x00007ffff5752fd5 in VirtualFileSystem::get_global_ptr() () from /usr/lib/panda3d/libpandaexpress.so.1.8
#12 0x00007ffff56d1cd8 in VirtualFileMountHTTP::reload_vfs_mount_url() () from /usr/lib/panda3d/libpandaexpress.so.1.8
#13 0x00007ffff56a8485 in init_libdownloader() () from /usr/lib/panda3d/libpandaexpress.so.1.8
#14 0x00007ffff56a86e6 in __static_initialization_and_destruction_0(int, int) [clone .constprop.259] () from /usr/lib/panda3d/libpandaexpress.so.1.8
#15 0x00007ffff7de9306 in call_init (l=<optimized out>, argc=1, argv=0x7fffffffdef8, env=0x7fffffffdf08) at dl-init.c:85
#16 0x00007ffff7de93df in call_init (env=<optimized out>, argv=<optimized out>, argc=<optimized out>, l=<optimized out>) at dl-init.c:52
#17 _dl_init (main_map=0x7ffff7ffe2c8, argc=1, argv=0x7fffffffdef8, env=0x7fffffffdf08) at dl-init.c:134
#18 0x00007ffff7ddb6ea in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
After I get this working I get to do the whole process again for Maya 2013. Heeeelp!