error compiling from cvs on debian squeeze

I tried to compile the latest cvs trunk on debian squeeze (64bit) using this command:

makepanda/makepanda.py --verbose --everything --use-bullet --threads 2 --optimize 1 --installer 

but this failed with an “undefined reference”:

... 
[T1] Building Interrogate database built/pandac/input/libp3distort.in[T2] Linking executable built/bin/apply_patch 
g++ -o built/bin/apply_patch -Lbuilt/lib -Lbuilt/tmp -L/usr/X11R6/lib built/tmp/apply_patch_apply_patch.o built/lib/libpanda.so built/lib/libpandaexpress.so built/lib/libp3dtool.so built/lib/libp3dtoolconfig.so built/lib/libp3pystub.a -pthread -lssl -lcrypto -lz -ldl 

built/bin/interrogate -srcdir panda/src/distort -Ipanda/src/distort -Dvolatile -Dmutable -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -D__const=const -D_LP64 -D_DEBUG -oc built/tmp/libp3distort_igate.cxx -od built/pandac/input/libp3distort.in -fnames -string -refcount -assert -python-native -Sbuilt/include/parser-inc -Ipanda/src/distort -Sbuilt/tmp -Sbuilt/include -S/usr/include/python2.6 -DMAKEPANDA= -DBUILDING_PANDAFX -module pandafx -library libp3distort config_distort.h cylindricalLens.h fisheyeLens.h nonlinearImager.h oSphereLens.h p3distort_composite1.cxx pSphereLens.h projectionScreen.h 
Process exited with exit status 1 and signal code 0 
The following command returned a non-zero value: g++ -o built/bin/apply_patch -Lbuilt/lib -Lbuilt/tmp -L/usr/X11R6/lib built/tmp/apply_patch_apply_patch.o built/lib/libpanda.so built/lib/libpandaexpress.so built/lib/libp3dtool.so built/lib/libp3dtoolconfig.so built/lib/libp3pystub.a -pthread -lssl -lcrypto -lz -ldl 
built/lib/libpanda.so: undefined reference to `PyObject_RichCompareBool' 
collect2: ld returned 1 exit status 
... 

I don’t know if documentation is up-to-date (INSTALL-MK) or there are some mistakes.
Thanks for help.

It seems as if you’re compiling against Python 3, which is not currently supported.

I have checked in a fix for the compile error, although this still won’t make it possible to use Panda3D with Python 3, and you are advised to clean your build and target Python 2 by running makepanda.py with python 2.

If I’m mistaken and you are in fact using Python 2, then please pick up the fix I checked in and try again.

I recompiled with latest fixes but there was another ‘undefined reference’:

...
built/lib/libpanda.so: undefined reference to `PyExc_Exception'
...

so, by dumbly following your latest fixes, I added these lines in dtool/src/pystub/pystub.cxx :

EXPCL_PYSTUB int PyExc_Exception(...);
int PyExc_Exception(...) { return 0; }

and now it seems to compile correctly, but, during creation of .deb package, there were warnings like these:

...
dpkg-gensymbols: warning: pattern 'usr/lib/panda3d/lib*.so*' did not match any file
cd targetroot ; LD_LIBRARY_PATH=usr/lib/panda3d dpkg-shlibdeps --ignore-missing-info --warnings=2 -xpanda3d1.9 -xlibphysx-extras -Tdebian/substvars_dep debian/panda3d1.9/usr/lib/panda3d/lib*.so*
objdump: 'debian/panda3d1.9/usr/lib/panda3d/lib*.so*': No such file
cd targetroot ; LD_LIBRARY_PATH=usr/lib/panda3d dpkg-shlibdeps --ignore-missing-info --warnings=2 -xpanda3d1.9 -Tdebian/substvars_rec debian/panda3d1.9/usr/bin/*
dpkg-shlibdeps: warning: /usr/lib/panda3d/libpandaexpress.so has an unexpected SONAME (libpandaexpress.so.1.9)
dpkg-shlibdeps: warning: Can't extract name and version from library name `libpandaexpress.so'
dpkg-shlibdeps: warning: Can't extract name and version from library name `libpandaexpress.so'
dpkg-shlibdeps: warning: /usr/lib/panda3d/libp3dtool.so has an unexpected SONAME (libp3dtool.so.1.9)
dpkg-shlibdeps: warning: Can't extract name and version from library name `libp3dtool.so'
dpkg-shlibdeps: warning: Can't extract name and version from library name `libp3dtool.so'
(...more lines like these last ones...)

and this error :

...
dpkg-deb: parse error, in file 'targetroot/DEBIAN/control' near line 7 package 'panda3d1.9':
 `Depends' field, missing package name, or garbage where package name expected
Process exited with exit status 2 and signal code 0
Storing dependency cache.
Elapsed Time: 15 min 22 sec
The following command returned a non-zero value: fakeroot dpkg-deb -b targetroot panda3d1.9_1.9.0_amd64.deb
Build terminated.

First of all, can you make sure you don’t have any copy of Panda3D installed while you’re building that?

Can you also verify that targetroot/usr/lib/panda3d/libpandaexpress.so is a symlink and not an actual library?

Could you give me the content of the targetroot/DEBIAN/control file that was generated by makepanda?

I uninstalled old .deb package

there is no symlink in targetroot/usr/lib/panda3d (there is only the folder python2.6)

this is the control’s content:

Package: panda3d1.9
Version: 1.9.0
Section: libdevel
Priority: optional
Architecture: amd64
Essential: no
Depends: , python2.6, python-pmw, nvidia-cg-toolkit
Recommends: panda3d-runtime, python-wxversion, python-profiler (>= 2.6), python-tk (>= 2.6), fftw2, libc6 (>= 2.3.2), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libpython2.6 (>= 2.6), libssl0.9.8 (>= 0.9.8m-1), libstdc++6 (>= 4.1.1), zlib1g (>= 1:1.2.0)
Provides: panda3d
Conflicts: panda3d
Replaces: panda3d
Maintainer: rdb <me@rdb.name>
Installed-Size: 479729
Description: The Panda3D free 3D engine SDK
 Panda3D is a game engine which includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Panda3D is open source and free software under the revised BSD license, and can be used for both free and commercial game development at no financial cost.
 Panda3D's intended game-development language is Python. The engine itself is written in C++, and utilizes an automatic wrapper-generator to expose the complete functionality of the engine in a Python interface.
 .
 This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.

OK, I’ve checked in a fix to makepanda.py. Try now.

that’s ok (compiled, installed and tested).
well done.