delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/04/18/13:28:29

X-Spam-Check-By: sourceware.org
Date: Tue, 17 Apr 2007 14:50:43 +0200 (MET DST)
From: Angelo Graziosi <Angelo DOT Graziosi AT roma1 DOT infn DOT it>
To: cygwin AT cygwin DOT com
Subject: Transforming a static library to a DLL
Message-ID: <Pine.OSF.4.21.0704171429110.2777-100000@ax0rm1.roma1.infn.it>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019