Pelles C forum
C language => Windows questions => Topic started by: czerny on May 14, 2013, 04:21:55 PM
-
I am trying to make a working import library for 'bgd.dll', a precompiled version of the gd-library.
In the following I have reduced the output to two typical functions to reduce the material.
>podump /EXPORTS bgd.dll
Dump of bgd.dll
File type: DLL
Exported symbols for bgd.dll
0 characteristics
41896739 time date stamp (Thu Nov 4 00:18:17 2004)
0.00 version
1 ordinal base
8A number of functions
8A number of names
ordinal hint address name
A 9 6D8952B4 gdFontGetTiny@0
B A 6D93E75C gdFontGiant
SUMMARY
11000 .bss
20000 .data
2000 .edata
1000 .idata
6000 .reloc
EB000 .stab
F1000 .stabstr
B5000 .text
There seems to me cdecl functions (gdFontGiant) and stdcall functions (gdFontGetTiny) in this dll.
polib bgd.dll /MACHINE:X86 /makedef:bgd.def
POLIB: fatal error: Corrupt library: 'bgd.dll'.
This command does not work as expected!
So I first made an import library with:
polib bgd.dll /MACHINE:X86 /out:bgd.lib
and afterwards
polib bgd.dll /MACHINE:X86 /makedef:bgd.def /out:bgd.lib
which produced
LIBRARY "bgd.dll"
EXPORTS
"gdFontGetTiny@0" ; bgd.dll
"_gdFontGiant" DATA ; bgd.dll
than I in got
podump /IMPORTS bgd.lib
Dump of bgd.lib
File type: LIB
bgd.dll: gdFontGetTiny@0 (gdFontGetTiny@0)
bgd.dll: gdFontGiant (_gdFontGiant)
SUMMARY
14 .idata$2
14 .idata$3
4 .idata$4
4 .idata$5
8 .idata$6
all this looks a little inconsistent to me. And it does not work
POLINK: error: Unresolved external symbol '_gdImageCreateTrueColor@8'.
I tryed all variants of PeExp2Def
(function)
LIBRARY bgd.dll
EXPORTS
gdFontGetTiny@0
gdFontGiant
("function")
LIBRARY bgd.dll
EXPORTS
"gdFontGetTiny@0"
"gdFontGiant"
(function = function@x)
LIBRARY bgd.dll
EXPORTS
gdFontGetTiny = gdFontGetTiny@0
gdFontGiant
(function@x ordinal)
LIBRARY bgd.dll
EXPORTS
gdFontGetTiny@0 @10
gdFontGiant @11
But that does not work too.
What I am doing wrong?
-
gdFontGetTiny@0 -> __stdcall decorated name takes zero arguments (0 bytes)
"_gdFontGiant -> __cdecl.
I'm not sure that you can use that library if you don't have a full header.
-
What I am doing wrong?
That dll seems to be for MinGW.
gdImageCreate@8 isn't normal __stdcall function name in win32, _gdImageCreate@8 or gdImageCreate is for win32.
_gdFontGiant is for data.
__declspec(dllimport) in header also means to use gdImageCreate
EDIT: some bgd.dll depends too much msvcrt.dll, so it can be useless with PellesC (different FILE struct?).
-
I'm not sure that you can use that library if you don't have a full header.
I have the header files. Problem is to create a working import library.
-
with a def file
_func@x = func@x
the code compiles. But than 'func' (not 'func@x') is searched for and not found.