The console/windows flag does not matter for a DLL, it's only used by exe
files, and microsoft usually never set the checksum to anything but 0,
anyway neither of these things has any effect on how your dll work.
It should work without any problems if the exported names and ordinal
numbers are the same, not sure at the moment what the problem could be.
----- Original Message -----
From: "Max Bane" <bane@...>
Sent: Wednesday, August 27, 2003 3:43 AM
Subject: [Mingw-users] DLL Linking Woes
> Hi, all.
> I have an MSVC-compiled executable. Let's call it super.exe. super.exe
> dynamically loads a DLL called ui/uix86.dll from its working directory. It
> expects uix86.dll to export two functions: dll_init and main_vm. They are
> exported with __cdecl. I am trying to use MinGW/MSYS to produce such a
> Compiling my code for uix86 into object files is a piece of cake. Linking
> into a usable DLL is not. First of all, here is the .def file I'm using to
> the DLL:
> Quite simple. I have looked here:
> and here:
> After reading these and searching the mailing list archives as well as
> sourceforge would let me, I've been trying to produce the DLL using this
> dllwrap --def ui.def -o pathtosuper/ui/uix86.dll *.o
> Problem is, super.exe simply fails to load the resulting DLL. After
> that first webpage, I figured that there shouldn't be any problems with
> function names (_'s and @'s and such) since my two functions are using the
> __cdecl calling convention. But I've tried the -k and --add-stdcall-alias
> options to dllwrap just in case. No difference as far as super.exe is
> So I used depends.exe (www.dependencywalker.com) to look at my uix86.dll
> compare it to an example DLL that I know works with super.exe. The
> function names are exactly the same in both, as are their ordinal numbers.
> However, I noticed the following differences: Their Hint #'s are swapped,
> has subsystem Console rather than GUI, and the example DLL has a link
> of zero, whereas my DLL's link checksum is non-zero and equals my Real
> So are any of these differences enough to explain why it isn't working? If
> how can I fix that up? If not, what do I need to change in the way I'm
> generating my DLL? I tried following that FAQ question I linked to above,
> doesn't help me at all -- first of all, I don't have the source to
> and I need to make a DLL it can link to at runtime, NOT a .lib (I assume
> the windows equiv of .a files?) it can link to at compile time. Basically,
> total noob to making DLLs and Windows programs in general -- I'm really a
> unix/linux programmer who has to write something for windows, and would
> rather use a familiar/portable build environment like MinGW rather than
> out for MSVC.
> Thanks for any help, guys (and gals).
> Max Bane
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> MinGW-users mailing list
> You may change your MinGW Account Options or unsubscribe at: