Generating an .a library?

BlitzMax Forums/BlitzMax Programming/Generating an .a library?

JoshK(Posted 2006) [#1]
I want to compile an .a library file. I have cpp source code, a dll, and a .lib file. How can I do this?


Dreamora(Posted 2006) [#2]
DLL and LIB are not needed.
All you need to do is create a makefile and compile it using MingW 3.1 (not 5.0)

Easiest way to do so - at least out of my sight - is the usage of Dev-C++ where you add a second compiler which is using 3.1 MingW installation you did for BM instead of the default (which is MingW 4 or 5 which is incompatible to BM)

After that, you create a new project (for static library), add all the source and compile it. With a little luck you already have some kind of project file (.dev is Dev-C++) you can load or at least import and either use directly or just have to change to compile to static library in the project settings.


Gabriel(Posted 2006) [#3]
Dreamora's answer is fine, unless you're using code which is available under either the GPL or LGPL licenses, in which case statically linking like that will mean you have to open source your code and so does anyone else who uses whatever you create with it.

If your DLL exports functions ( not classes ) then you can just use the method Drago describes here ( third post from the top ) :

http://www.blitzbasic.com/Community/posts.php?topic=41803