libtool
[Top][All Lists]
Advanced

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

Re: having a lot of mingw build problems with atexit - what does it mean


From: Ed Hartnett
Subject: Re: having a lot of mingw build problems with atexit - what does it mean?
Date: Tue, 05 Dec 2006 09:07:06 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> Hello Ed,
>
> * Ed Hartnett wrote on Tue, Dec 05, 2006 at 12:43:25AM CET:
>> 
>> I am having a lot of trouble building my library with libtool under
>> mingw. I keep getting these errors relating to atexit. Can anyone
>> enlighten me as to what that is?
>
>> libtool: link: (cd ".libs" && rm -f "libnetcdf.lib" && ln -s
>> "libnetcdf-0.dll" "libnetcdf.lib")
>
> Without checking much, this strikes me as a little odd.  Do you have a
> tarball URL available, so we can see what you're doing?  Alternatively,
> the Makefile.am's that are responsible for libnetcdf.la and t_nc?

You can get the netcdf daily tarball at:
ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-daily.tar.gz

To get the most simplified case which has this problem, configure it
like this with mingw:

./configure --enable-c-only --enable-shared --enable-dll && make check

My library seems to build OK as a DLL. (When I test it with Visual
Studio, it works). 

But my own tests don't build in the case of a dll. The first test
program it tries is t_nc.c, and that fails to link because of the
atexit error. Here's the link of the library and the attempt to build
t_nc:

/bin/sh ../libtool --tag=CC --mode=link gcc  -g -O2   -o libnetcdf.la
-rpath /usr/local/lib -version-info 0:0:0 -no-undefined
-Wl,--output-def,.libs/libnetcdf.def  attr.lo ncx.lo putget.lo dim.lo
error.lo libvers.lo nc.lo string.lo v1hpg.lo var.lo  posixio.lo   
libtool: link: gcc -shared  .libs/attr.o .libs/ncx.o .libs/putget.o
.libs/dim.o .libs/error.o .libs/libvers.o .libs/nc.o .libs/string.o
.libs/v1hpg.o .libs/var.o .libs/posixio.o    -Wl,--output-def
-Wl,.libs/libnetcdf.def -o .libs/libnetcdf-0.dll
-Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker
.libs/libnetcdf-0.dll
Creating library file: .libs/libnetcdf-0.dll
libtool: link: (cd ".libs" && rm -f "libnetcdf.lib" && ln -s
"libnetcdf-0.dll" "libnetcdf.lib")
libtool: link: ar cru .libs/libnetcdf.a  attr.o ncx.o putget.o dim.o
error.o libvers.o nc.o string.o v1hpg.o var.o posixio.o
libtool: link: ranlib .libs/libnetcdf.a
libtool: link: creating libnetcdf.la
libtool: link: ( cd ".libs" && rm -f "libnetcdf.la" && ln -s
"../libnetcdf.la" "libnetcdf.la" )
make  t_nc.exe
make[2]: Entering directory `/c/cygwin/home/ed/n3_new1/libsrc'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../fortran  -DDLL_NETCDF   -g
-O2 -MT t_nc-t_nc.o -MD -MP -MF ".deps/t_nc-t_nc.Tpo" -c -o
t_nc-t_nc.o `test -f 't_nc.c' || echo './'`t_nc.c; \
then mv -f ".deps/t_nc-t_nc.Tpo" ".deps/t_nc-t_nc.Po"; else rm -f
".deps/t_nc-t_nc.Tpo"; exit 1; fi
/bin/sh ../libtool --tag=CC --mode=link gcc  -g -O2   -o t_nc.exe
t_nc-t_nc.o libnetcdf.la 
libtool: link: gcc -g -O2 -o .libs/t_nc.exe t_nc-t_nc.o
./.libs/libnetcdf.lib -L/usr/local/lib
./.libs/libnetcdf.lib(.text+0x160):crtstuff.c: multiple definition of
`atexit'
/mingw/lib/crt2.o(.text+0x2b0):crt1.c: first defined here
./.libs/libnetcdf.lib(.text+0x190):crtstuff.c: multiple definition of
`_onexit'
/mingw/lib/crt2.o(.text+0x2c0):crt1.c: first defined here
./.libs/libnetcdf.lib(.text+0x1c0):crtstuff.c: multiple definition of
`__do_sjlj_init'
C:/msys/1.0/mingw/bin/../lib/gcc/mingw32/3.4.2/crtbegin.o(.text+0x0):crtstuff.c:
first defined here
t_nc-t_nc.o(.text+0x1d8): In function `main':
c:/cygwin/home/ed/n3_new1/libsrc/t_nc.c:369: undefined reference to
`_imp__nc__create'
t_nc-t_nc.o(.text+0x237):c:/cygwin/home/ed/n3_new1/libsrc/t_nc.c:372:
undefined reference to `_imp__nc__create'
...



-- 
Ed Hartnett  -- address@hidden





reply via email to

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