Subject: mingw32 and 3rd party .dll's
From: [email-masked] (Dale Smith)

24 Mar 1998 10:25:24 -0800
Message-ID: <3518c1f9.856062152.cygnus.gnu-win32@mailhost>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
To: [email-masked]

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@1 while the .def file has
MSFL1_CloseDirectory@4.  I changed the "char" to an "int" and gcc is now
looking for MSFL1_CloseDirectory@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
[email-masked]
Cleveland Linux Users Group: http://cleveland.lug.net/
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".