Page 1 of 1

Linking to Chipmunk using FreeBASIC

Posted: Wed Dec 21, 2011 11:40 am
by MrOz
Hey guys, I don't know if this is an issue with FreeBASIC, or with chipmunk, so maybe you gents have an idea.

Anywho, this is the issue: When I'm compiling with multiple modules/files, I get a lot of errors about multiple references to all the chipmunk functions.

FreeBASIC works similarly to gcc, so when I do something like this:
fbc source.file -l chipmunk

Everything is fine, but if I do something like:
fbc source1.file source2.file -l chipmunk
It starts to complain about multiple references

I've also tried compiling and not linking until the end like this:
fbc source1.file -c
fbc source2.file -c
fbc *.o -l chipmunk -x "sometest.exe"

Again, the multiple references issue crops up again.

Is this an issue in the C-dialect versions, or is there perhaps something wrong with my translated headers (I did the translation by hand, but don't think I left anything important out).

Any insight into this would be super duper :)
-Oz

Re: Linking to Chipmunk using FreeBASIC

Posted: Wed Dec 21, 2011 1:31 pm
by slembcke
Is it using the C headers in some way? I have a lot of static inline functions in them that FreeBASIC might be trying to generate code for in every source module.

Re: Linking to Chipmunk using FreeBASIC

Posted: Wed Dec 21, 2011 1:50 pm
by MrOz
Nope, it's only using my translated headers, which have the inline functions translated properly.
:?

Re: Linking to Chipmunk using FreeBASIC

Posted: Sat Oct 04, 2014 8:39 pm
by Dave
Hey guys. I know this is an old topic, but I was wondering of anyone is still maintaining this port? I have an old version here and I'd like to start using the new features. Also, I ran into those duplicated issues, and since FreeBASIC doesn't support inline functions, I used private functions.

Re: Linking to Chipmunk using FreeBASIC

Posted: Sat Oct 04, 2014 9:37 pm
by MrOz
I have been occasionally updating my repository as people request or as I need it. It's a little behind now, but if you need something beyond 6.1, I can update to 7.0, just let me know.

-MrOz

Re: Linking to Chipmunk using FreeBASIC

Posted: Fri Jun 14, 2019 3:48 pm
by Dave
Hello, sorry about posting in such an old thread, but it felt like a bad thing to start a new one with the exact same topic.
Anyway, is there any information on a current FreeBASIC compatible version of Chipmunk?
I've been looking around, but the only stuff I can find is really old.
Thanks.

Re: Linking to Chipmunk using FreeBASIC

Posted: Tue Jul 02, 2019 7:34 am
by MrOz
Hi Dave,

Sadly, I haven't touched FreeBASIC in a number of years.

You can check out some work I did a long time ago here: https://github.com/mrozbarry/Chipmunk-P ... /freebasic

The version is 7 years old, _but_ it has a snapshot of chipmunk from 7 years ago, too, so you should have something compatible.

That said, I have no idea what state I left the repository in, and it may not work at all, but it should give you a place to start.

Porting C libraries to FreeBASIC isn't too bad, FreeBASIC is pretty close to ansi-C.

Have fun!
- Oz