[NCLUG] Need help compiling a Judy module for Python

Marcio Luis Teixeira marciot at holly.colostate.edu
Fri Jul 26 16:07:11 MDT 2002


Hi there,

I'm trying to use SWIG to create a Python module for Judy. Anyhow, everything 
goes well during compilation, but when I try to use the module, I get the 
following:

   Python 1.5.2 (#1, Apr  3 2002, 18:16:26)  [GCC 2.96 20000731 (Red Hat Linux    
7.2 2 on linux-i386
   Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
   >>> import Judy
   Traceback (innermost last):
      File "<stdin>", line 1, in ?
   ImportError: ./Judymodule.so: undefined symbol: __builtin_delete
   >>>

The SWIG website says that if you're using C++ (I am) and you're supposed to 
link to libgcc.a, libg++.a, and libstdc++.a. The problem is, I can't figure 
out how to tell "ld" to do so. Here are the commands I execute:

    swig -python -shadow -c++ Judy.i
    g++ -c Judy_wrap.c -I/usr/include/python1.5 -I/usr/lib/python1.5/config
    g++ -c Judy1.cc -I/usr/include/python1.5 -I/usr/lib/python1.5/config
    ld -shared Judy1.o Judy_wrap.o -l Judy -o Judymodule.so -lg++

All the commands work except for the last. "ld" replies:

    ld: cannot find -lg++

I checked in "/usr/lib", I have these two files:

    libg++.so.2.7.2
    libg++.so.2.7.2.8

So they seem to be there. What am I missing??

Anyhow, the same thing happens when I try using "-lgcc" or "-lstdc++". Anyhow, 
I seem to be very close and I'm probably doing something stupid. Any help 
would be appreciated.

Thanks,

Marcio Luis Teixeira






More information about the NCLUG mailing list