Qbasicnews.com

Full Version: Does anyone have a copy of the utility to make .dll.a files?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm trying to port a dll header to freebasic but it's not going to work without a .dll.a file. Does anyone have the tool nek made to do it, since nodtveit is down?
Adosorken ( http://fb.nodtveidt.net ) wrote a batch file with the needed tools to do that ( posted here: http://forum.qbasicnews.com/viewtopic.php?t=7740 ).
His site is down, so I post ( @ Adosorken - hope you don't mind... ) the readme file and the batch file:

makea.txt
  • This is a collection of files necessary to make .a files from dlls to which you don't have the .def file for. The two executables are part of the standard MinGW distribution. I wrote the batch file. To use this, place all the files in your FreeBASIC \bin directory. Copy your dll to the FreeBASIC \bin directory, and use <b>makea dllname</b> from the FreeBASIC \bin directory. Make sure you don't use the extension or the batch file will fail. If there are no errors reported, you'll find the .a file in your FreeBASIC \lib directory, ready to be used.

    Thanks to v1ctor for explaining this process. You rock, man. Smile
makea.bat
  • @echo off
    pexports -o %1.dll >%1.def
    dlltool --def %1.def --dllname %1.dll --output-lib lib%1.dll.a
    move lib%1.dll.a ..\lib
    del %1.def
As you can see you need pexports.exe and dlltool.exe.
You can get dlltool and pexports from the mingw package.

And no, I don't mind fsw Big Grin actually, I believe you can get this file on freebasic.tk as well...
Here for those without guts to download mingw:
http://hybd.net/~mms/fb/pexports.exe (13kb)
http://hybd.net/~mms/fb/dlltool.exe (187kb)
Thanks everyone. Now my evil port of SDL_Net can finally commence and fail miserably! MWAHAHAHAHAHA!

(actually, I've already managed to get the init going -- I only want to be able to toss TCP packets around, after all)
Hey, I get this error when trying to make the .dll.a file for a library (is is a valid win32 dll):
Code:
E:\freeBASIC\bin>makea zlib1
pexports: zlib1.dll: could not load PE image
dlltool: Syntax error in def file zlib1.def:0

I'm screwbarred, aren't I?
It is strange. If I run "makea sth.dll", I get the same error. But "makea sth" runs ok.
I found the problem with zlib (freeimage also did this and they gave a solution). You need sed.exe for non-VC compiled stuffs since the PE image doesn't exist as such.
Quote:It is strange. If I run "makea sth.dll", I get the same error. But "makea sth" runs ok.
There's nothing strange about that. If you had read the instructions for makea, you'd have noticed that you are required to leave out the .dll extension or the process will fail. Tongue
My question:
I have get libpython23.dll.a by Adosorken's makea.bat
and here is the fbc code
Code:
Declare Function Py_Initialize Lib "python23" Alias "Py_Initialize" () As Long
Declare Function Py_IsInitialized Lib "python23" Alias "Py_IsInitialized"() As Long
Declare Function Py_Finalize Lib "python23" Alias "Py_Finalize"() As Long

Declare Function Py_GetPath Lib "python23" Alias "Py_GetPath"() As Long
Declare Function Py_GetVersion Lib "python23" Alias "Py_GetVersion"() As Long
Declare Function PyRun_SimpleString Lib "python23" Alias "PyRun_SimpleString"(ByRef command As String) As Long


Sub Main()
    Py_Initialize
    init = Py_IsInitialized
    ver = PyGetVersion
    Print ver
    Py_Finalize
End Sub

Main
but when I compile, I get
Quote:py.o(.text+0x2f):fake: undefined reference to `Py_Initialize@0'
py.o(.text+0x34):fake: undefined reference to `Py_IsInitialized@0'
py.o(.text+0x4e):fake: undefined reference to `Py_Finalize@0'
what is the matter?
Pages: 1 2