Boost logo

Boost Users :

From: doak87508 (jdoak_at_[hidden])
Date: 2002-02-27 13:20:44


I am playing around with using an archive to created a shared library
(.so file) instead of linking all the individual objects. I have
success when I link individual objects:

% g++ -shared classes.o conversions.o errors.o extension_class.o
functions.o init_function.o module_builder.o objects.o types.o
cross_module.o getting_started1.o -o getting_started1.so

% python
1;31mh[1] >>> import getting_started1
1;31mh[1] >>> getting_started1.greet()
'hello, world'

Now, I create an archive:

% ar r libboost_python.a classes.o conversions.o errors.o
extension_class.o functions.o init_function.o module_builder.o
objects.o types.o cross_module.o

Then, I link that archive into the shared library:

% g++ -shared libboost_python.a getting_started1.o -o
getting_started1.so

% python
1;31mh[1] >>> import getting_started1.so
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: ./getting_started1.so: undefined symbol:
add__Q35boost6python19module_builder_basePQ45boost
6python6detail8functionPCc

I have also tried linking as follows with no change in result:

% g++ -shared -L. -lboost_python getting_started1.o -o
getting_started1.so

Does someone know how to get linking working with an archive file?

JD


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net