Howdy all!

I am a programmer of a free scientific software package, netCDF, used
widely in climate science and meteorology.

Recently I managed to get my C library building and testing cleanly on
Linux for windows, using mingw32 and wine. This is the greatest idea
since sliced bread. (In fact, I would rather live without sliced bread!)

But something has recently gone wrong and it is not working for me, due
to some libtool confusion on my part, probably.

The daily snapshot of the package can be obtained here:
ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-4-daily.tar.gz

I am building it like this:
./configure -C --disable-dap --disable-netcdf-4 --disable-fortran --disable-cxx 
--build=x86_64-unknown-linux-gnu --host=i686-mingw32 && make -j check

When it builds in the nc_test directory, there is a program (nc_test)
which needs to link to the math library. I have AC_CHECK_LIB(m) in the
configure.ac, so the math library has been found and added to LIBS. But
libtool strips it away!

/bin/sh ../libtool --tag=CC   --mode=link gcc  -g -O2   -o nc_test nc_test.o 
error.o test_get.o test_put.o test_read.o test_write.o util.o 
../liblib/libnetcdf.la -lm 
libtool: link: gcc -g -O2 -o nc_test nc_test.o error.o test_get.o test_put.o 
test_read.o test_write.o util.o  ../liblib/.libs/libnetcdf.a
util.o: In function `dbl2nc':
/machine/netcdf/trunk/nc_test/util.c:268: undefined reference to `floor'
/machine/netcdf/trunk/nc_test/util.c:278: undefined reference to `floor'
/machine/netcdf/trunk/nc_test/util.c:273: undefined reference to `floor'
collect2: ld returned 1 exit status

As I read the above, when make calles libtool, it has the -lm, but when
libtool calls gcc, the -lm is missing.

Any idea what I might be doing wrong here?

Thanks,

Ed


-- 
Ed Hartnett  -- e...@unidata.ucar.edu

_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool

Reply via email to