[19073] in s-news-athena
Re: [S] dll's, g77, sqpe.dll and tearing out my hair
daemon@ATHENA.MIT.EDU (Prof Brian D Ripley)
Tue Aug 31 18:29:54 1999
Date: Tue, 31 Aug 1999 22:46:24 +0100 (BST)
From: Prof Brian D Ripley <ripley@stats.ox.ac.uk>
To: Steve Buyske <buyske@stat.rutgers.edu>
Cc: s-news@wubios.wustl.edu
In-Reply-To: <v04210100b3f1eb75831a@[192.168.1.254]>
Message-Id: <Pine.GSO.4.05.9908312226480.8959-100000@auk.stats>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Tue, 31 Aug 1999, Steve Buyske wrote:
> I've been trying for a day to compile a dll for S-Plus 2000 on
> Windows 98/NT from Fortran code (Jim Hughes's censre2 function,
> http://www.biostat.washington.edu/biostat/faculty/hughes/censre.tarfil
> e, but I'd like to know how to do this in general) that calls the
> DBLEPR and INTPR functions. The Programmer's Guide suggests that I
> might be able to link with sqpe.lib to do so. But how?
That's for Visual C++. And *WARNING* the distributed sqpe.lib is for VC++
6.0, not VC++4.x as the Programmer's Guide claims. It will not work
with 4.2, at least.
> Based on Prof. Ripley's advice to others, I've tried
> g77 -c -o censre2.o censre2.f
> dllwrap --export-all-symbols -o censre2.dll censre2.o -L. -lsqpe
> without success. The first line is fine, but the second fails, because it
> can't find -lsqpe. I should mention that I've moved copies of
You need to make it, by
dlltool --dllname Sqpe.dll Sqpe.def --output-lib libSqpe.a
where Sqpe.def sits in the SHOME/lib directory (and needs the
development libraries installed), and I had to remove a couple of $****.
entries from Sqpe.def to get this to work.
> sqpe.dll and sqpe.lib to the same directory as the code in question.
>
> I'm not much of a Windows program (and censre2 compiles in a snap on
> Unix), and so I'm not sure if I'm making a stupid error or attempting
> something impossible.
It should be possible, but is tricky. I have had problems (like crashes)
with --export-all-symbols when linking against an import library, so I
would do the following
g77 -c censre2.f
dlltool --export-all-symbols --output-def censre2.def censre2.o
dllwrap -o censre2.dll --def censre2.def censre2.o libSqpe.a
which if I have copied it right should work. Please ask again if it does
not.
Frustratingly, lots of things in this area only work in a few of the many
ways one can try to do them, or depend on compiler versions. A year or so
ago I just could not get gcc to work, and that appears to be due to a
linker bug that causes problems on one version of Windows, the one I had
then. So don't think it is necessarily you.
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news