Transforming a static library to a DLL

Angelo Graziosi
Tue Apr 17 12:50:00 GMT 2007

I have a set of static fortran libraries (CERNLIB, and I would transform
them into DLLs.

The libraries have been compiled mainly with command:
g77 -c -O -fno-automatic -fno-second-underscore -fugly-complex...

gcc -O1 -fomit-frame-pointer...

and they are used linking as:
g77 foo.F .... /usr/local/cernlib/2005/lib/libmathlib.a
     -L/usr/lib -lcrypt -ldl

Trying to transform in DLL, for example the library 'libmathlib.a', I
have tried this:

   gcc -shared -o cygmathlib.dll \
       -Wl,--enable-auto-image-base \
       -Wl,--out-implib=libmathlib.dll.a \
       -Wl,--whole-archive libmathlib.a \
       -Wl,--no-whole-archive -lg2c

but it fails with a lot of :
libmathlib.a(arithm.o):cccrN4fn.f:(.text+0x17): undefined reference to
libmathlib.a(arithm.o):cccrN4fn.f:(.text+0x154): undefined reference to
libmathlib.a(d501l1.o):cc44FCLd.f:(.text+0x2dd): undefined reference to

Perhaps I have forgot to add some other library on command line. 

How can I determine that? ...or is, perhaps, the above method completely

(I have tried to follow the method used for Lapack package in Cygwin).



Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list