libtool
[Top][All Lists]
Advanced

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

shared libraries possible with old g++, g77?


From: Ed Hartnett
Subject: shared libraries possible with old g++, g77?
Date: Tue, 13 May 2008 19:00:58 -0600
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Howdy all!

I am the maintainer for a freeware scientific software library called
netcdf. There are C, Fortran, and C++ libraries.

When building shared libraries with older versions of the tools, I get
problems. gcc works fine, and I get a shared C library, but my fortran
and C++ programs seg fault instead of working. For example:

libtool: link: g++ -shared -o .libs/libnetcdf_c++.so.4  .libs/netcdf.o
.libs/ncvalues.o
-Wl,-blibpath:/opt/gnu/gcc/lib:/opt/gnu/bin/../lib/gcc-lib:/opt/gnu/gcc/lib/g\
cc-lib/powerpc-ibm-aix5.0.0.0/3.2:/opt/gnu/gcc/lib/gcc-lib/powerpc-ibm-aix5.0.0.0/3.2/../../..:/usr/lib:/lib
-L/opt/gnu/bin/../lib/gcc-lib -L/opt/gnu/gcc/lib/gcc-lib/p\
owerpc-ibm-aix5.0.0.0/3.2
-L/opt/gnu/gcc/lib/gcc-lib/powerpc-ibm-aix5.0.0.0/3.2/../../.. 
-L/opt/gnu/gcc/lib
-lstdc++ -L/machine/objgcc/powerpc-ibm-aix5.0.0.0/libstdc++\
-v3/src
-L/machine/objgcc/powerpc-ibm-aix5.0.0.0/libstdc++-v3/src/.libs
-L/machine/objgcc/gcc -lm -lc -lgcc_s -Wl,-bnoentry
-Wl,-bE:.libs/libnetcdf_c++.exp -Wl,-ber\
ok
ld: 0711-415 WARNING: Symbol _GLOBAL__I__ZN6NcFileD2Ev is already
exported.
ld: 0711-415 WARNING: Symbol _GLOBAL__D__ZN6NcFileD2Ev is already
exported.
ld: 0711-415 WARNING: Symbol _GLOBAL__F__ZN6NcFileD2Ev is already
exported.
ld: 0711-415 WARNING: Symbol _GLOBAL__I__ZN8NcValuesC2Ev is already
exported.
ld: 0711-415 WARNING: Symbol _GLOBAL__D__ZN8NcValuesC2Ev is already
exported.
ld: 0711-415 WARNING: Symbol _GLOBAL__F__ZN8NcValuesC2Ev is already
exported.
libtool: link: ar cru .libs/libnetcdf_c++.a .libs/libnetcdf_c++.so.4
libtool: link: ( cd ".libs" && rm -f "libnetcdf_c++.la" && ln -s
"../libnetcdf_c++.la" "libnetcdf_c++.la" )
        make  nctst tst_failure
        depbase=`echo nctst.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; g++
        -DHAVE_CONFIG_H -I. -I.. -I../fortran        -I../libsrc   -g
        -O2 -MT nctst.o -MD -MP -MF $depba\
se.Tpo -c -o nctst.o nctst.cpp && mv -f $depbase.Tpo $depbase.Po
        /bin/sh ../libtool --tag=CXX    --mode=link g++  -g -O2
        -o nctst nctst.o ../cxx/libnetcdf_c++.la
        ../libsrc/libnetcdf.la
libtool: link: g++ -g -O2 -o .libs/nctst nctst.o  -L../cxx/.libs
-lnetcdf_c++ -L/machine/objgcc/powerpc-ibm-aix5.0.0.0/libstdc++-v3/src
-L/machine/objgcc/powerpc-ibm-a\
ix5.0.0.0/libstdc++-v3/src/.libs -L/machine/objgcc/gcc
-L/opt/gnu/gcc/lib -lstdc++ -lm -lc -lgcc_s -L../libsrc/.libs -lnetcdf
-Wl,-blibpath:/usr/local/lib:/opt/gnu/gcc\
/lib:/opt/gnu/bin/../lib/gcc-lib:/opt/gnu/gcc/lib/gcc-lib/powerpc-ibm-aix5.0.0.0/3.2:/opt/gnu/gcc/lib/gcc-lib/powerpc-ibm-aix5.0.0.0/3.2/../../..:/usr/lib:/lib
        depbase=`echo tst_failure.o | sed
        's|[^/]*$|.deps/&|;s|\.o$||'`; g++ -DHAVE_CONFIG_H
        -I. -I.. -I../fortran        -I../libsrc   -g -O2 -MT
        tst_failure.o -MD -M\
P -MF $depbase.Tpo -c -o tst_failure.o tst_failure.cpp && mv -f
$depbase.Tpo $depbase.Po
        /bin/sh ../libtool --tag=CXX    --mode=link g++  -g -O2
        -o tst_failure tst_failure.o ../cxx/libnetcdf_c++.la
        ../libsrc/libnetcdf.la
libtool: link: g++ -g -O2 -o .libs/tst_failure tst_failure.o
-L../cxx/.libs -lnetcdf_c++
-L/machine/objgcc/powerpc-ibm-aix5.0.0.0/libstdc++-v3/src
-L/machine/objgcc/p\
owerpc-ibm-aix5.0.0.0/libstdc++-v3/src/.libs -L/machine/objgcc/gcc
-L/opt/gnu/gcc/lib -lstdc++ -lm -lc -lgcc_s -L../libsrc/.libs -lnetcdf
-Wl,-blibpath:/usr/local/lib:\
/opt/gnu/gcc/lib:/opt/gnu/bin/../lib/gcc-lib:/opt/gnu/gcc/lib/gcc-lib/powerpc-ibm-aix5.0.0.0/3.2:/opt/gnu/gcc/lib/gcc-lib/powerpc-ibm-aix5.0.0.0/3.2/../../..:/usr/lib:\
/lib
        make  check-TESTS
*** Testing C++ API with 2 different netCDF formats.
/bin/sh: 14312 Segmentation fault(coredump)


Is this expected? Or should I be able to build shared libraries with
version 3.2 of g++ and g77?

Thanks!

Ed
-- 
Ed Hartnett  -- address@hidden




reply via email to

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