[C++-sig] Link trouble on OS X

Scott A. Smith ssmith at magnet.fsu.edu
Thu May 30 14:57:32 CEST 2002


Hi Dave,

I had time to look at the Boost.Python build under OS X again.
Recall that the build dies in the linking step, complaining about
undefined symbols:

> > /usr/bin/ld: Undefined symbols:
> > _main
> > _PyErr_SetObject
> > _PyErr_SetString
> > _PyExc_IndexError
> > _PyExc_RuntimeError
> > _PyExc_ValueError
>
> OK, it looks like OS X might be one of those platforms which requires
> linking against the Python library. Try adding -lpython to the
> command line

That didn't work, but adding -lpython2.2 did remove this set. On the
Mac I have (Python installed using Fink), things reside in /sw/lib/python2.2
and there is a library libpython2.2.a in the config sub-directory from
there.

> > _main
> > ___builtin_delete
> > ___builtin_new
> > ___cp_push_exception
> > ___eh_alloc
> > ___pure_virtual
> > ___rtti_si
> > ___rtti_user
> > ___throw
> > ___vt_9exception
>
> These are functions in your compiler's runtime library. Have you got
> multiple versions of GCC installed? In particular, have you got a 2.95.x
> and a 3.x version installed? If so, you may not have properly supplied
> GCC_ROOT_DIRECTORY to let the build system know how to find the runtime.

No, I am pretty sure that there is only a single GCC on the system. It is
2.95.2 (which they call 934.2 in the OS X port) and invoked with "cc" not
"gcc". Similarly, g++ is invoked with c++. I had a look in /usr/lib and
found that this is were libstdc++.a lives, so I set the variable
GCC_ROOT_DIRECTORY to /usr. Unfortunately the above group of symbols are
still undefined. Any ideas?

Thanks,
Scott

-----------------------------------------
-----------------------------------------

 Dr. Scott A. Smith
 Associate in Research
 National High Magnetic Field Laboratory
 1800 East Paul Dirac Drive
 Tallahassee, FL 32310

 phone: (850) 644-6348
 FAX:   (850) 644-1366
 email: ssmith at magnet.fsu.edu
 http://www.magnet.fsu.edu
 http://gamma.magnet.fsu.edu






More information about the Cplusplus-sig mailing list