hbmk2 bug ?

201 views
Skip to first unread message

Felix Pablo Grande

unread,
Sep 3, 2020, 2:41:57 AM9/3/20
to Harbour Developers
Hello,

when creating an import library with mingw, the library created is the same size as the dll used. On the other hand, with Borland it is not like that.

Is it a hbmk2 bug with mingw?

I have used unrar.dll http://www.winrar.es/descargas/32/descargar-unrar-dll-para-windows-en-ingles

Running the following command: hbmk2 -hbimplib unrar.dll

With MinGW: UnRar.dll size(262Kb) libUnRar.a size(262Kb)

With Borland: UnRar.dll size(262Kb) UnRar.lib(2Kb)

Thanks in advance !

Best regards,

Grigory Filatov

unread,
Sep 3, 2020, 4:11:30 AM9/3/20
to Harbour Developers
Hello Felix Pablo,

You should use another tool for your conversion from the dll to a library file.

I've converted this dll with Lib2A tool successfully.

With MinGW: UnRar.dll size(261Kb) libUnRar.a size(10Kb)

My unrar.def file is below:

LIBRARY "UnRAR.dll"
EXPORTS
RARCloseArchive@4
RARGetDllVersion@0
RAROpenArchive@4
RAROpenArchiveEx@4
RARProcessFile@16
RARProcessFileW@16
RARReadHeader@8
RARReadHeaderEx@8
RARSetCallback@12
RARSetChangeVolProc@8
RARSetPassword@8
RARSetProcessDataProc@8


HTH,
Grigory

четверг, 3 сентября 2020 г., 9:41:57 UTC+3 пользователь Felix Pablo Grande написал:

Felix Pablo Grande

unread,
Sep 3, 2020, 4:52:30 AM9/3/20
to Harbour Developers
Hi Grigory !

Thanks a lot for your help. Could you tell us where can download lib2a tool from ? Could you tell us how to use this tool ?

Thanks in advace.

Best regards,

Grigory Filatov

unread,
Sep 3, 2020, 5:02:07 AM9/3/20
to Harbour Developers
Felix Pablo,

Please take a look for the following link:

https://www.softpedia.com/get/Programming/Other-Programming-Files/LIB-to-A-Converter.shtml

Regards,
Grigory

четверг, 3 сентября 2020 г., 11:52:30 UTC+3 пользователь Felix Pablo Grande написал:

Felix Pablo Grande

unread,
Sep 3, 2020, 6:35:32 AM9/3/20
to Harbour Developers
Hi Grigory,

we can generate def file with MinGW gendef.exe

gendef UnRar.def

;
; Definition file of UnRAR.dll
; Automatic generated by gendef
; written by Kai Tietz 2008
;
LIBRARY "UnRAR.dll"
EXPORTS
RARCloseArchive@4
RARGetDllVersion

RAROpenArchive@4
RAROpenArchiveEx@4
RARProcessFile@16
RARProcessFileW@16
RARReadHeader@8
RARReadHeaderEx@8
RARSetCallback@12
RARSetChangeVolProc@8
RARSetPassword@8
RARSetProcessDataProc@8

After this, we can use dlltool to create libunrar.a

dlltool.exe -d UnRar.def -D UnRar.dll -k -l libUnRar.a

Thanks for your time and help.

Best regards,
Message has been deleted

Klas Engwall

unread,
Sep 3, 2020, 6:48:30 AM9/3/20
to harbou...@googlegroups.com
Hi Felix,

Please note that this is not the place for support requests. And do read
the instructions at the top of the home page of the group:

https://groups.google.com/forum/#!forum/harbour-devel

Your original post was allowed into the group due to a glitch in how new
members are handled in the Google Groups software.

Regards,
Klas
> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to harbour-deve...@googlegroups.com
> <mailto:harbour-deve...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/harbour-devel/08105c4b-e9ca-4e7f-9cd1-2fe290c7fa6en%40googlegroups.com
> <https://groups.google.com/d/msgid/harbour-devel/08105c4b-e9ca-4e7f-9cd1-2fe290c7fa6en%40googlegroups.com?utm_medium=email&utm_source=footer>.

Felix Pablo Grande

unread,
Sep 3, 2020, 11:36:36 AM9/3/20
to Harbour Developers
Hi Klas,

sorry but I think hbmk2 has an error when creating import libraries with MinGW.

hbmk2 -hbimplib unrar.dll

Because of this I have published the post.

Sorry for the inconvenience.

Best regards,

Mindaugas Kavaliauskas

unread,
Sep 16, 2020, 9:18:24 AM9/16/20
to harbou...@googlegroups.com
Hi,

as far as I remember, MinGW is capable to use .dll files as lib files.
You need just copy .dll to .a file. Try byte compare these files to
check the assumption (fc /b filename1 filename2).
Not space efficient, but useful. It should not make any influence on
size of the final executable.


Best regards,
Mindaugas
Reply all
Reply to author
Forward
0 new messages