delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/03/24/10:25:24

From: dale DOT smith AT bellhow DOT com (Dale Smith)
Subject: mingw32 and 3rd party .dll's
24 Mar 1998 10:25:24 -0800 :
Message-ID: <3518c1f9.856062152.cygnus.gnu-win32@mailhost>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Greetings!

I hope this is the right place to ask mingw32 questions.  Please be gentle!

I'm (attempting) to use mingw32 as a target.  I am using two different host
platforms, solaris and linux.  I am trying to link against a dll from Equis
International.  They have provided a .def file and headers along with import
..lib's for borland and Microsoft.

I'm building the mingw32 import library with:

DLLTOOL= i386--mingw32-dlltool --as i386--mingw32-as

libmsfl65.a: msfl65.def msfl65.dll
	$(DLLTOOL) --def msfl65.def --dllname msfl65.dll --output-lib $@


The first thing that is weird was the names that gcc want's to use and the
names in the .def file.  For an example, the header has a prototype like this:

#ifdef __cplusplus
  #define MSFLFUNC extern "C"
#else
  #define MSFLFUNC extern
#endif

MSFLFUNC int __stdcall MSFL1_CloseDirectory(char cDirNumber);

Gcc wants to call this MSFL1_CloseDirectory AT 1 while the .def file has
MSFL1_CloseDirectory AT 4.  I changed the "char" to an "int" and gcc is now
looking for MSFL1_CloseDirectory AT 4.  Great.  Gcc and msc have different ideas
on how many bytes a char takes up on the stack.

Anyway, the program links cleanly, but can't seem to find the function.

"The procedure entry point xxx could not be located in the dynamic link
library msfl65.dll"

Where xxx IS what is in the .def file.

Any takers?

Thanks!
   Dale


-- 
Dale P. Smith
dale DOT smith AT bellhow DOT com
Cleveland Linux Users Group: http://cleveland.lug.net/
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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