[Gdal-dev] static libraries revamped (was: new build strategy for org/orgsf_frmts/)

Norman Vine nhv at cape.com
Thu Jul 24 10:38:37 EDT 2003

Amici Alessandro writes:
> > 
> you mean:
> $ g++ -Wl,--relocateable -o ogr.o ogrcurve.o ogrlinestring.o
> ogrlinestring.o(.eh_frame+0x67c):ogrlinestring.cpp: reloc refers to symbol
> `.text$_ZN8OGRCurveD0Ev' which is not being output
> ogrlinestring.o(.eh_frame+0x6a8):ogrlinestring.cpp: reloc refers to symbol
> `.text$_ZN8OGRCurveD1Ev' which is not being output
> collect2: ld returned 1 exit status
> no luck :(

Oh well it was worth a try

Hmm....  I just noticed this in the ld docs

     For anything other than C++ programs, this option is equivalent to
     `-r': it generates relocatable output--i.e., an output file that
     can in turn serve as input to `ld'.  When linking C++ programs,
     `-Ur' _does_ resolve references to constructors, unlike `-r'.  It
     does not work to use `-Ur' on files that were themselves linked
     with `-Ur'; once the constructor table has been built, it cannot
     be added to.  Use `-Ur' only for the last partial link, and `-r'
     for the others.

so maybe

ld -Ur -o ogr.o ogrcurve.o ogrlinestring.o

If that doesn't work maybe a question to gcc-help at gcc.gnu.org
is in order



More information about the Gdal-dev mailing list