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]

Transforming a static library to a DLL


I have a set of static fortran libraries (CERNLIB,
http://www.webalice.it/angelo.graziosi/Cernlib.html) 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,--enable-auto-import
       -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
`_funct_'
libmathlib.a(arithm.o):cccrN4fn.f:(.text+0x154): undefined reference to
`_funct_'
libmathlib.a(d501l1.o):cc44FCLd.f:(.text+0x2dd): undefined reference to
`_dvset_'
...
-------------------------------------

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

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

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



TIA,

   Angelo.


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


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