[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cxx archiver

From: Patrick Guio
Subject: cxx archiver
Date: Fri, 27 Oct 2000 15:51:40 +0200 (CEST)

Dear all
As you know I am trying to use libtool :-) Now on a DEC machine when I am
trying to create a library, here what is happening:
The sources are well compiled, for example:

% source='argparsing.cpp'
object='libutilities_la-argparsing.lo' libtool=yes \
tmpdepfile='.deps/libutilities_la-argparsing.TPlo' \
depmode=dashmstdout /bin/ksh ../depcomp \
/bin/ksh ../libtool --mode=compile cxx
-I. -I. -I.  -DHDF -I/astro/local/opt/HDF_4.1r3/4.1r3_digunix/include
-I/mn/sothi/u1/patrickg/src/blitz -DFLOAT_FIELD -ptr util -nocompress -std
strict_ansi -DBZ_DISABLE_XOPEN_SOURCE -ieee -c -o
libutilities_la-argparsing.lo `test -f argparsing.cpp || echo
-I. -I. -I. -DHDF -I/astro/local/opt/HDF_4.1r3/4.1r3_digunix/include
-I/mn/sothi/u1/patrickg/src/blitz -DFLOAT_FIELD -ptr util -nocompress -std
strict_ansi -DBZ_DISABLE_XOPEN_SOURCE -ieee -c argparsing.cpp -o
echo timestamp > libutilities_la-argparsing.lo

*Note* that I had to specify in libutilities_la_CXXFLAGS the option
-ptr util 
This is just to indicate that the templates for this library should go
there. Actually it should be better to have -ptr libutilities_la for

Then it does

/bin/ksh ../libtool --mode=link cxx  -nocompress -std strict_ansi
-DBZ_DISABLE_XOPEN_SOURCE -ieee  -L/mn/sothi/u1/patrickg/src/blitz/lib
-lblitz -L/astro/local/opt/HDF_4.1r3/4.1r3_digunix/lib -lmfhdf -ldf -ljpeg
-lz -o -rpath /usr/local/lib util/*.o -version-info 0:0:0
libutilities_la-argparsing.lo libutilities_la-integrate.lo  -lm 
mkdir .libs

*** Warning: Linking the shared library against the
*** objects 
and so on many templates!!!!!
is not portable!
rm -fr .libs/ .libs/libutilities.* .libs/libutilities.*
(cd . && ln -s libutilities_la-argparsing.lo libutilities_la-argparsing.o)
(cd . && ln -s libutilities_la-integrate.lo libutilities_la-integrate.o)

What is the problem with those templates!? 
Thereafter it just overwrite the .o just .lo containing timestamp...

ar cru .libs/libutilities.a 


ranlib .libs/libutilities.a

Which doesnot work since the .o (not the templates but the objects) are
not there anylonger but just 'timestamp'

I have suceeded to link manually and the recipe is 

Compile as libtool do it now
Archive with the following command

ar -ts libutilities_la-argparsing.o ..... util/*.o 
or maybe
ar -ts libutilities_la-argparsing.o ..... libutilities_la/*.o

Then when linking this library, everything work smoothly
cxx -c main.cpp
cxx main.o -o main -lutilities


Patrick Guio

                                  Patrick Guio
                    Institute of Physics, University of Oslo
                      P.O. box 1048, Blindern, N-0316 Oslo
               Tel : (+47) 22 84 40 60 - Fax : (+47) 22 85 56 71
                        E-mail : address@hidden 
                          URL :

reply via email to

[Prev in Thread] Current Thread [Next in Thread]