#130 dllwrap create incorrected import lib

Feature_requests
closed
Danny Smith
binutils (105)
2002-04-26
2002-04-26
No

I follow to this instruction to create import
library for existing dll :

echo EXPORTS > file.def
nm file.dll | grep ' T _' | sed 's/.* T _//' >>
file.def
dlltool --def file.def --dllname file.dll --output-
lib file.a

And if declarartion of function contains __stdcall in
header of this dll, I couldn't link my application
with this import library.
(I get linker errors for these stdcall functions:
cciAaaaa.o(.text+0x1e6):test.c: undefined referenc
e to `GdiplusStartup@12').

If I add @12 to GdiplusStartup in file.def and
rebuild, I get error from Windows : The procedure
entry point GdiplusStartup@12 couldn't be located in
the dynamic link libarary GdiPlus.dll.

Could you please explain me how to do it.
(My target is to create import library for dll, which
contains __stdcall functions)

Discussion

  • Danny Smith
    Danny Smith
    2002-04-26

    • status: open --> closed
     
  • Danny Smith
    Danny Smith
    2002-04-26

    Logged In: YES
    user_id=11494

    You need to put the __stdcall decoration onto function
    symbols in your def file. eg

    EXPORTS
    GdiplusStartup@12

    Then add --kill-at (or -k) to dlltool command to alias
    those names to undecorated names in the dll.

    dlltool --kill-at --def file.def --dllname file.dll \ --output-lib file.a

    Danny