This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Building an import lib from a DLL - egcs 1.1


At 11:54 07/10/98 +0900, Colin Peters wrote:
>There is a utility called impdef (you can get it at
>http://www.geocities.com/Tokyo/Towers/6162/gcc-extra.html )
>which will
>output the exports of a dll in the correct format for a .def file.
>Unfortunately it doesn't work with dlls built with the latest MSVC compilers.

Thanks a lot for this, I'll give it a bash.



>Second problem is stdcall functions (with @nn at the end). This is a real
>bugger because there is no way to find out the number to put there just from
>the exports of a DLL (if wlink can properly generate such things then it is
>doing some magic-- possibly the compiler just doesn't use the @nn convention
>for stdcall functions). gcc needs those @'s and the correct numbers in the
>.def file. One way to figure out what numbers you need is to try to compile
>a program and simply copy the numbers given in the error messages.


Ummm.... does not compute?? Which numbers do you mean? Do you mean when it
tries to link it'll complain about missing externals, and I just look to
see what they're called (i.e. 4, @8 etc) ?

My workaround was to look in msql.h, and if the prototype was e.g.
msqlStandOnYourHead (int, int, char*)
then put
msqlStandOnYourHead@12
into the def file - 12 bytes of parameters. This seems to be working so
far, have I understood this aright? And surely There Must Be An Easier Way.

>Luckily
>you only have to do this once... it would be nice if you would make it
>available for others if you do.

When I'm sure it's solid I shall do so. What's the form here - post code
snippets to the list, or submit it to you/Mumit Khan/JanJaap or someone
else? I'll post it to the mSQL people as well.

Thanks for the advice,

Regards,
Tom.


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]