Porting a lib? - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html) +--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html) +--- Thread: Porting a lib? (/thread-8761.html) |
Porting a lib? - Torahteen - 01-17-2006 If I wanted to port the FANN Library to FB, what would be the steps that I would take? Porting a lib? - L_O_J - 01-17-2006 well I never port libs before but, here is a way that I might think of : 1. the hard way, rewrite all the lib source to FB ( total port ) :p, and then recompile in FB (you dont want to do this tho ) 2. just take the library file in MingW / GCC format (".a") and then translate the header to FB format. thats it. hope it helps Porting a lib? - na_th_an - 01-17-2006 I think someone created a sort of automatic header translator, am I right? Then basicly you obtain the .a file (compiling the C source in mingw32, for example), translate the headers into .bi files and do some manual editing/double checks. Porting a lib? - Antoni Gual - 01-17-2006 Yes, v1ctor created a SWIG script to translate .h to .bi, you can have the package here http://www.freebasic.net/temp/swig_fb.zip Porting a lib? - Torahteen - 01-17-2006 Ok, so how do I use that program for one. Two, so all I need is the .a file? Wether that be in C or not? Porting a lib? - Torahteen - 01-18-2006 I need to compile the library, but I have no clue how. Could somebody walk me through the steps in Dev-C++ or MSVC.NET? Porting a lib? - d.j.peters - 01-18-2006 The lib is in C for C++ or dotnet you need only the language bindings. Why you will build the lib new? Joshy Porting a lib? - Torahteen - 01-18-2006 For MSVC, the library has a project for you to compile, which should automatically make the new library file. However, it creates error upon error when it does this. I don't know what to do. Porting a lib? - d.j.peters - 01-18-2006 Sorry about my bad english i don't know what you try. You don't need to compile the whole lib. If you will use the lib in FreeBASIC you must declare the functions. This is the FreeBASIC code from "simple_test.c" in the example folder. I have test it and it works. (it must be in the same folder as "xor_float.net") Joshy Code: type fann as any ptr Code: #include <stdio.h> Porting a lib? - d.j.peters - 01-29-2006 run's your first "neuronal" network now? Joshy |