Converting Microsoft lib (.LIB) to FreeBASIC lib (.dll.a)
Converting Microsoft lib (.LIB) to FreeBASIC lib (.dll.a)
When you download a software package consisting of one or more dynamic link libraries (extension .dll) it is not unlikely for the package to also contain
- include files (extension: .h)
- Microsoft import libraries (extension: .LIB)
If you're lucky there will be .dll.a files (=fb import libraries) in the package as well. But what if the package does not contain .dll.a files?
This is what you do.
First go to MingGW on sourceforge
and download binutils and mingw utils from sourceforge (make sure you get the binaries). Obviously you'll have to unpack the downloaded archives.
You need three programs to convert files with extension .LIB to files with extension .dll.a
- dlltool;
- as;
- reimp.
dlltools and as are in the binutils archive, reimp is in the mingw utils archive. reimp is the program that will do the actual conversion (reimp needs dlltool and as to do it's thing).
An example ('how to use reimp').
Suppose you have downloaded a Microsoft dll called iup.dll and the import library that comes with it (called iup.LIB). To turn iup.LIB into libiup.dll.a do the following.
Type
reimp iup.lib
at a commandline prompt.
(make sure dlltool, as and reimp are in the working directory or in the windows path).
The result of the execution of reimp iup.lib is a library called iup.a That's almost what is needed but not quite. FreeBASIC needs import libraries to start with the word 'lib' and end with the extension '.dll.a' you'll have to rename iup.a to libiup.dll.a
After you've renamed the file to libiup.dll.a and copied it to the map where the rest of the FreeBASIC libraries are (something like c:\program files\freebasic\lib\win32\) you can almost start using iup.dll/iup.dll.a
Almost because you'll still have to convert the appropriate header files to FreeBASIC (one of these header files will include the statement
#inclib "iup").
End of example, end of message. Enjoy using reimp.
- include files (extension: .h)
- Microsoft import libraries (extension: .LIB)
If you're lucky there will be .dll.a files (=fb import libraries) in the package as well. But what if the package does not contain .dll.a files?
This is what you do.
First go to MingGW on sourceforge
and download binutils and mingw utils from sourceforge (make sure you get the binaries). Obviously you'll have to unpack the downloaded archives.
You need three programs to convert files with extension .LIB to files with extension .dll.a
- dlltool;
- as;
- reimp.
dlltools and as are in the binutils archive, reimp is in the mingw utils archive. reimp is the program that will do the actual conversion (reimp needs dlltool and as to do it's thing).
An example ('how to use reimp').
Suppose you have downloaded a Microsoft dll called iup.dll and the import library that comes with it (called iup.LIB). To turn iup.LIB into libiup.dll.a do the following.
Type
reimp iup.lib
at a commandline prompt.
(make sure dlltool, as and reimp are in the working directory or in the windows path).
The result of the execution of reimp iup.lib is a library called iup.a That's almost what is needed but not quite. FreeBASIC needs import libraries to start with the word 'lib' and end with the extension '.dll.a' you'll have to rename iup.a to libiup.dll.a
After you've renamed the file to libiup.dll.a and copied it to the map where the rest of the FreeBASIC libraries are (something like c:\program files\freebasic\lib\win32\) you can almost start using iup.dll/iup.dll.a
Almost because you'll still have to convert the appropriate header files to FreeBASIC (one of these header files will include the statement
#inclib "iup").
End of example, end of message. Enjoy using reimp.
you can download from here http://prdownloads.sourceforge.net/ming ... z?download
By default Windows (stupidly) hides the extension so "libIUP.dll.a" would show in Explorer as "libIUP.dll".Kenny80 wrote:Strange thing is that i get a .dll file instead of .a i both tried reimp name.lib and reimp -c name.lib still get a dll hehe
Windows XP (2k and 9x are similiar to this):
http://www.wikihow.com/Disable-Hidden-F ... Windows-XP
Vista and 7:
http://vistasupport.mvps.org/disable_hi ... types.html
Thanks AGS, this is a much better explanation than my attempt :(
http://www.freebasic.net/forum/viewtopi ... highlight=
http://www.freebasic.net/forum/viewtopi ... highlight=