Subject: MSVC and dlls
From: [email-masked] (root)

3 Jun 1997 11:06:59 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Content-Type: text
Original-To: [email-masked]
Original-Sender: [email-masked]

> 
> I am still unable to use dlls created with Visual C++ 4.2 with gcc and
> I'm starting to wonder if perhaps there is a dll version conflict with
> the cygwin32 dll. Maybe someone can shed some light on this.
> 
> I've built a VERY simple dll in MSVC. If I compile the test app in
> MSVC, all works fine. However, if I use the b18 dlltool and compile
> the test app with b18 gcc, I get the "Unable to run..." message on
> Windows95. Gdb reports error number 11.

'Unable to run' means that 'ld' has screwed up something and the format
of the generated executable is wrong.

> 
> What makes me suspicious of the dll revision? Here are some
> observations:
> 
> The dll's export table does not show up using pedump on both Windows95
> and NT 4.0. It also does not show up using Quick View on Windows95.

This is a serious hint to the diagnostic above: 'ld' has screwed up the
executable.

> 
> It does, however, show up using Quick View on NT 4.0 or Microsoft's
> "dumpbin" utility. Did Microsoft rev. the dll format? If so, perhaps
> there is something in the cygwin dll that can't handle the newer
> format.

Nope. Microsoft hasn't changed the dll format in any incompatible way.
The reason is very simple: All dlls circulating around wouldn't work
anymore, and several millions of Win95 users would have surely noticed
such a change...

> 
> The dlltool command that I run on the MSVC dll is
> 
> 	dlltool --def test.def --dllname test.dll --output-lib libtest.a
>

A possible reason for this problem, is that MSVC would put the export
table in the rdata section, to save space. 
If you have compiled the MSVC dll using any optimizations, recompile
without any optimizations.
Another good idea would be to use an older version of MSVC, maybe 2.0
(of course not a 16 bit version, be careful)

-- 
Jacob Navia	Logiciels/Informatique
41 rue Maurice Ravel			Tel 01 48.23.51.44
93430 Villetaneuse 			Fax 01 48.23.95.39
France
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".