[Solved] PyExc_ValueError

Hello!

I would like to use Panda3D with C++ under Ubuntu Linux 64 Bit.
I tried with Code::Blocks and with Netbeans and was able to build but when I try to execute the following error appears:

symbol lookup error: /usr/lib64/panda3d/libpandaexpress.so.1.8: undefined symbol: PyExc_ValueError

Any idea?

Welcome to the forums!

I think you forgot to link to libpython.

thank you very much for your reply - and sorry for the delay. my settings are:

includes:
/usr/include/panda3d
/usr/include/python2.7

compiler options:
-fPIC -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lp3direct

library directories:
/usr/lib64/panda3d

library files:
/usr/lib/libpython2.7.so

what do i have to change? thank you in advance.

You shouldn’t attempt to link to both pystub and python - you should remove the reference to libpython if you link to pystub.

The -l flags should be passed to the linker, not to the compiler.

ok, thank you. made the changes as you said. it’s still not working. :confused: :frowning: i get the same error as before.

Could you show the full commands?

Sure. Would be nice if I could attach screenshots of the settings in netbeans, but I didn’t find an easy way to do that in this forum. But I hope the output of the building process contains the necessary information…

“/usr/bin/make” -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: se ingresa al directorio «»
“/usr/bin/make” -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/
make[2]: se ingresa al directorio «»
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d

g++ -c -g -s -I/usr/include/panda3d -I/usr/include/python2.7 -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.cpp
mkdir -p dist/Debug/GNU-Linux-x86
g++ -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3direct -o dist/Debug/GNU-Linux-x86/ build/Debug/GNU-Linux-x86/main.o -L/usr/lib64/panda3d
[i]make[2]: se sale del directorio «»
make[1]: se sale del directorio «»

BUILD SUCCESSFUL (total time: 3s)[/i]

(I generalized the paths and project name)

I’m not seeing -lp3pystub in the linker command.

yes I removed it, but as far as I could see it makes no difference if it’s there or not…

I tried both and a lot more combinations without success :cry:

Can you confirm (using nm) that libp3pystub contains the symbol in question, and can you confirm (using ldd) that the executable you are running is indeed linked to libp3pystub?

ok, the first one was positive:

nm /usr/lib64/panda3d/libp3pystub.so | grep PyExc_ValueError
0000000000204040 B PyExc_ValueError

then the second one not, so I left the grep away to show the entire result:

ldd <FileName>
	linux-vdso.so.1 =>  (0x00007fff828ea000)
	/opt/lib/libmediaclient.so (0x00007fd7893b0000)
	libp3framework.so.1.8 => /usr/lib64/panda3d/libp3framework.so.1.8 (0x00007fd78913a000)
	libpanda.so.1.8 => /usr/lib64/panda3d/libpanda.so.1.8 (0x00007fd7874b6000)
	libp3dtoolconfig.so.1.8 => /usr/lib64/panda3d/libp3dtoolconfig.so.1.8 (0x00007fd787258000)
	libp3dtool.so.1.8 => /usr/lib64/panda3d/libp3dtool.so.1.8 (0x00007fd78701c000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd786d14000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd786afe000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd78675d000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd78653f000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd786337000)
	libpandaexpress.so.1.8 => /usr/lib64/panda3d/libpandaexpress.so.1.8 (0x00007fd785d58000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd785ad3000)
	libavformat.so.53 => /usr/lib/libavformat.so.53 (0x00007fd7857e3000)
	libavcodec.so.53 => /usr/lib/libavcodec.so.53 (0x00007fd784aab000)
	libavutil.so.51 => /usr/lib/libavutil.so.51 (0x00007fd78488c000)
	libswscale.so.2 => /usr/lib/libswscale.so.2 (0x00007fd784654000)
	libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fd7843bc000)
	libCg.so => /usr/lib/libCg.so (0x00007fd783453000)
	libtiff.so.4 => /usr/lib/x86_64-linux-gnu/libtiff.so.4 (0x00007fd7831f0000)
	libjpeg.so.62 => /usr/lib/x86_64-linux-gnu/libjpeg.so.62 (0x00007fd782fcb000)
	libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007fd782da2000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd782b8a000)
	libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fd7827db000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd7825d6000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd7895c2000)
	libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fd782385000)
	libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x00007fd782174000)
	libvpx.so.0 => /usr/lib/libvpx.so.0 (0x00007fd781ed3000)
	libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007fd781a04000)
	libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007fd7817d7000)
	libtheoraenc.so.1 => /usr/lib/libtheoraenc.so.1 (0x00007fd781598000)
	libtheoradec.so.1 => /usr/lib/libtheoradec.so.1 (0x00007fd78137e000)
	libspeex.so.1 => /usr/lib/x86_64-linux-gnu/libspeex.so.1 (0x00007fd781164000)
	libschroedinger-1.0.so.0 => /usr/lib/libschroedinger-1.0.so.0 (0x00007fd780ebe000)
	libgsm.so.1 => /usr/lib/libgsm.so.1 (0x00007fd780cb0000)
	libva.so.1 => /usr/lib/libva.so.1 (0x00007fd780a85000)
	libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007fd78087e000)
	liborc-0.4.so.0 => /usr/lib/liborc-0.4.so.0 (0x00007fd780604000)

this time the build options were:

g++ -m64    -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lp3direct -o dist/Debug/GNU-Linux-x86/<ProjectName> build/Debug/GNU-Linux-x86/main.o -L/usr/lib64/panda3d

everything else the same as in the example above

Huh. For some linkers, the order in which you specify the libraries matters, so try changing the order of -lp3pystub to be last in the command.

I doubt that’s what’s going on here, though. Are you sure you made a clean build? Many IDEs will actually not rebuild your executable unless the code changed or if you specifically clean the build first.

ok, it seems that the order really matters. Now i get:

symbol lookup error: /usr/lib64/panda3d/libp3dtool.so.1.8: undefined symbol: _Py_NoneStruct

Yes I always use “Clean and Build”

Motivation is fading away…

Can anyone who managed to use Panda3D with C++ under Linux please show me the used configuration? :blush:

Have you tried remove -m64 tag?..

My “basic” Makefile looks like:

CC = g++
OBJ_T = mfwt1.o
EXE_T = main_fw_t1e

CFLAGS = -o $(OBJ_T) -fPIC -O2 -I"/usr/include/panda3d" -I"/usr/include/python2.7"
LFLAGS = -o $(EXE_T) -fPIC -L"/usr/lib/panda3d" -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lp3direct

all: mainfw_executable

mainfw_object: MainFramework_t1.cxx
	$(CC) $(CFLAGS) -c MainFramework_t1.cxx

mainfw_executable: mainfw_object
	$(CC) $(OBJ_T) $(LFLAGS)

clean:
	rm $(OBJ_T)
	rm $(EXE_T)

I’m on Ubuntu 12.04 64 bit @ Dell vostro 1520. Can you give me your specs? :slight_smile:

yes i tried also without the -m64 tag.

I have also updated to Ubuntu 12.04 recently and made the mistake to remove Panda3D - with the intension to reinstall it. As I had to see, there is no official package available for Precice Pangolin at the moment. I’ll wait, maybe the solution comes with it.

I have an Acer Aspire 5755G Laptop with Nvidia Optimus (Geforce GT540M) graphic card. I also switched from ironhide to bumblebee with the upgrade.

Playing around with OGRE at the moment.

I forgot that It happens last Ubuntu upgrade, there wasn’t package avaialbles for current SO and I had to wait, but now I do not uninstall any package and went on with normal update, nothing is break :smiley:.

I can see your processor is 64 bit, so I suppose that you’re running ubuntu amd64, have you tried doing

~$ file /usr/lib64/panda3d/libp3dtool.so.1.8

To see if the library is correctly 64-bit?

yes as I said before 64-bit…

no, but I’ll do it when I have the Panda3D libraries back. At the moment I can’t do anything. Trying to reinstall the libraries was a (desperate) act of trying to get things working.

I could try to build from sources… but I prefer to wait (at least some days)

Thank you anyway

I tried again to build from sources and this solved my problems.
In my case it could be done like this:

sudo apt-get install bison flex
wget http://www.panda3d.org/download/panda3d-1.8.0/panda3d-1.8.0.tar.gz
tar -xf panda3d-1.8.0.tar.gz
cd panda3d-1.8.0
./makepanda/makepanda.py --everything --installer
sudo dpkg -i panda3d1.8_1.8.0_amd64.deb