This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linking to static libraries, e.g. gsl and hdf5


Il 10/17/2013 11:02 PM, Susi Lehtola ha scritto:
Hi,


it seems that linking to some static libraries has broken down since the
last time I tried to recompile my project (in April). Now the linking
commands fail, e.g.

/usr/bin/g++.exe  -Wall -O2 -funroll-loops -mtune=generic -msse2 -static
-fopenmp program.cpp -lgsl -lgslcblas -llapack -lblas -lgfortran

results in

/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld:
cannot find -lgsl
/usr/lib/gcc/i686-pc-cygwin/4.7.3/../../../../i686-pc-cygwin/bin/ld:
cannot find -lgslcblas

I also get the same error when linking to -lhdf5.

Having had a look at /usr/lib, I noticed that a lot of the libraries
follow the *nix convention
of the static libraries being named libfoo.a, while others have names of
the type libfoo.dll.a.
Indeed, the latter was true for the GSL and the HDF5 libraries, and
symlinking

/usr/lib/libgsl.a -> /usr/lib/libgsl.dll.a
/usr/lib/libgslcblas.a -> /usr/lib/libgslcblas.dll.a
/usr/lib/libhdf5.a -> /usr/lib/libhdf5.dll.a

solved the problem.

Why is this not done in the gsl and hdf5 packages? Other packages might
also be affected.

/usr/lib/libhdf5.dll.a is the dynamic library
so the workaround is a contradiction of your target
" Linking to static libraries"





--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]