porting libraries
porting libraries
I wasn't sure how to search for this, so I'm asking here:
Say I found a really cool library that I want to use in FB, but it's written in C. How do I go about making it useable in FB? I do know c/c++, but would I have to rewrite every line of code, or is there a simpler way to port it? Maybe this should be in the beginners section, I don't know.
Thanks
Say I found a really cool library that I want to use in FB, but it's written in C. How do I go about making it useable in FB? I do know c/c++, but would I have to rewrite every line of code, or is there a simpler way to port it? Maybe this should be in the beginners section, I don't know.
Thanks
I don't know what it was compiled with, but I do have the static library. When I try to #inclib though, something goes wrong. Here's the code, and the .bas file is in the same directory as libChipmunk.a
Here's the compiler log:
I don't know how to figure out what the problem is from this. I really hope I don't have to compile everything myself, I wouldn't know where to start.
As an alternative solution, could you maybe point me toward a properly compiled 2d rigid body physics lib?
Code: Select all
#inclib "libChipmunk.a"
Code: Select all
FreeBASIC Compiler - Version 0.18 (08-13-2007) for win32 (target:win32)
Copyright (C) 2004-2007 The FreeBASIC development team.
compiling: C:\FB\chipmunk\ChipmunkStaticLib1\test.bas -o C:\FB\chipmunk\ChipmunkStaticLib1\test.asm
assembling: C:\PROGRA~1\FREEBA~1\bin\win32\as.exe --strip-local-absolute "C:\FB\chipmunk\ChipmunkStaticLib1\test.asm" -o "C:\FB\chipmunk\ChipmunkStaticLib1\test.o"
linking: -T "C:\PROGRA~1\FREEBA~1\bin\win32\i386pe.x" -subsystem console -s --stack 1048576,1048576 -L "C:\PROGRA~1\FREEBA~1\lib\win32" -L "./" "C:\PROGRA~1\FREEBA~1\lib\win32\crt2.o" "C:\PROGRA~1\FREEBA~1\lib\win32\crtbegin.o" "C:\FB\chipmunk\ChipmunkStaticLib1\test.o" -o "C:\FB\chipmunk\ChipmunkStaticLib1\test.exe" -( -llibChipmunk.a -lfb -lgcc -lmsvcrt -lkernel32 -lmingw32 -lmingwex -lmoldname -lsupc++ "C:\PROGRA~1\FREEBA~1\lib\win32/fbrt0.o" -) "C:\PROGRA~1\FREEBA~1\lib\win32\crtend.o"
As an alternative solution, could you maybe point me toward a properly compiled 2d rigid body physics lib?
http://www.ode.org/
http://www.freebasic.net/forum/viewtopi ... hysics+lib
*me thinks ODE has already been ported*
Look for the ODE folder in FB/inc. But I dont see example bundled with FBC distro.
http://www.freebasic.net/forum/viewtopi ... hysics+lib
*me thinks ODE has already been ported*
Look for the ODE folder in FB/inc. But I dont see example bundled with FBC distro.
Yep, ODE is fully ported, thanks to our good friend Joshy here! Unfortunately, it seems to be made just for 3d implimentations. I'm nowhere near ready to start up with that! That's why I was trying to find a way to use chipmunk.
I'm sure there's a way to use ODE for 2d progs, but it just seems too complicated for me to grasp at my n00b stature. I'm gonna go look at newton some more and see if I can find a 2d implimentation there.
Thanks for the help guys!
I'm sure there's a way to use ODE for 2d progs, but it just seems too complicated for me to grasp at my n00b stature. I'm gonna go look at newton some more and see if I can find a 2d implimentation there.
Thanks for the help guys!
FB port of HGE has additional 2D physics library (box2D). You can learn HGE in a day + you'll have awesome 2D physics.
Just check it here http://www.freebasic.net/forum/viewtopic.php?t=9701
Just check it here http://www.freebasic.net/forum/viewtopic.php?t=9701
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
hello aleofjax
you are welcome to use the OpenDE FreeBASIC package
i ported the drawstuff lib to FreeBASIC so you test the
included examples.
here are the download links for Win32 and Linux:
http://www.freebasic.net/wiki/wikka.php?wakka=ExtLibode
Joshy
you are welcome to use the OpenDE FreeBASIC package
i ported the drawstuff lib to FreeBASIC so you test the
included examples.
here are the download links for Win32 and Linux:
http://www.freebasic.net/wiki/wikka.php?wakka=ExtLibode
Joshy
-
- Posts: 775
- Joined: Jul 01, 2005 18:45
Well, that's aufully nice of the linker. It'd be nice if the compiler log could have mentioned something about that. "Unable to open liblibChipmunk.a.a" or something like that. Maybe in a future release?
Thanks for the tip VS! I should be creating some really cool stuff now ... as soon as I learn all the chipmunk functions, that is.
Thanks for the tip VS! I should be creating some really cool stuff now ... as soon as I learn all the chipmunk functions, that is.