[Top][All Lists]
[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: |
Thu, 01 Feb 2007 11:31:34 -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 Fri, Dec 08, 2006 at 03:12:34AM CET:
>>
>> This must have been a Nd problem. When I upgraded to gcc 3.4.2
>> the whole problem went away.
>
> Hmm, that still worries me, plus I'm not sure what Nd means;
> is that similar to PEBKAC?
No, I was trying to type "ld."
Now the problem is back for me. Doh!
If you want to see it in action, get the daily build:
ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-daily.tar.gz
And build it like this:
./configure --enable-shared --enable-dll --enable-c-only && make check
The result is that it builds the dll, seeminly correctly, but fails
when it tries to build the first test, t_nc.c:
address@hidden ~/netcdf-3.6.2-beta6/libsrc
$ make check
make t_nc.exe
make[1]: Entering directory
`/c/cygwin/home/ed/netcdf-3.6.2-beta6/libsrc'
/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/netcdf-3.6.2-beta6/libsrc/t_nc.c:369: undefined
reference to `_imp__nc__create'
t_nc-t_nc.o(.text+0x237):c:/cygwin/home/ed/netcdf-3.6.2-beta6/libsrc/t_nc.c:372:
undefined reference to `_imp__nc__create'
t_nc-t_nc.o(.text+0x272):c:/cygwin/home/ed/netcdf-3.6.2-beta6/libsrc/t_nc.c:377:
undefined reference to `_imp__nc_put_att_text'
etc...
But if I compile the same programs, with .libs/libnetcdf-4.dll instead
of .libs/libnetcdf.lib, it works fine.
This is weird, because as far as I can tell, the .lib and the .dll
files are the same!
This works:
address@hidden ~/netcdf-3.6.2-beta6/libsrc
$ gcc -DHAVE_CONFIG -I. -I.. -I../fortran -o t_nc.exe t_nc.c
.libs/libnetcdf-4.dll
This doesn't:
address@hidden ~/netcdf-3.6.2-beta6/libsrc
$ gcc -DHAVE_CONFIG -I. -I.. -I../fortran -o t_nc.exe t_nc.c
.libs/libnetcdf.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
C:/DOCUME~1/ed/LOCALS~1/Temp/ccikbaaa.o(.text+0x1cb):t_nc.c: undefined
reference to `_imp__nc_def_dim'
C:/DOCUME~1/ed/LOCALS~1/Temp/ccikbaaa.o(.text+0x236):t_nc.c: undefined
reference to `_imp__nc_inq_dim'
etc.
Any thoughts?
Thanks!
Ed
--
Ed Hartnett -- address@hidden