Box2D Forums

It is currently Tue May 21, 2013 9:46 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Box2D Linux Library?
PostPosted: Sat Dec 22, 2007 7:50 pm 
Offline

Joined: Mon Sep 17, 2007 8:31 pm
Posts: 40
I've been trying to get my project, which uses Box2D, to compile on a linux computer, without success. The project is being developed on Windows, but I'm trying to make it compatible both ways. Everything is working but the Box2D. I have already looked through the forum, and tried the solutions offered, and those don't work. Does anyone have a library/solution that will work on FC3?

One of the methods offered on the forums got me a library, and it compiled, but at runtime it says a library is missing (but it's not). This is odd, because it seems like it should be statically linked, not accessed at runtime (but I'm a Linux-compiling noob).

Thanks for any help you can give.


Top
 Profile  
 
 Post subject: Re: Box2D Linux Library?
PostPosted: Sun Dec 23, 2007 2:13 pm 
Offline

Joined: Thu Nov 29, 2007 2:33 pm
Posts: 50
I've compiled Box2D 1.4.3 on my Linux w/o any problems, except of compiler warnings. I'm using Ubuntu 7.04.
To create makefile, I've used qmake, the Qt's build system. (project file attached)

You are using ancient linux distribution (FC 3 it's over 3 years old, which seems like ages in Linux world). This may be the source of some of your problems.

Please, post detailed information and error messages, I'll do my best to help You.

Attached file is a .pro (it is renamed to box2d.txt due to forum limitations. Rename it back to box2d.pro after You download it) file I'm using with my project, with Qt-4.3.2 (but should be usable with older Qt version, event 3.x.y). To generate makefile:

- copy the file to box2d source directory - the directory when you see 'Collision', 'Common' and 'Dynamics' subdirectories,
- run qmake on the file:
Code:
qmake box2d.pro
. This of requires you to have qt-devel package installed.
- run make. The result should be a libbox2d.a file in the same directory.

The .pro is syntax quite simple and readable, try to play with it. Good luck!

PS: if you'd like, i'd send You compiled binary. But it probably wont work on old linux.


Attachments:
File comment: qmake's project file.
box2d.txt [1.73 KiB]
Downloaded 278 times
Top
 Profile  
 
 Post subject: Re: Box2D Linux Library?
PostPosted: Thu Jan 03, 2008 3:05 pm 
Offline

Joined: Mon Sep 17, 2007 8:31 pm
Posts: 40
Thank you for the info.

I'm coming to the conclusion that the makefile I have is for a dynamically linked library, and I need to find either a makefile for a statically linked one, or figure out how to edit the one I have to make it a static library. I've tried to do it with the dynamically linked library, and when I run it, I get a segmentation fault.

Any ideas?


Top
 Profile  
 
 Post subject: Re: Box2D Linux Library?
PostPosted: Thu Jan 03, 2008 4:33 pm 
Offline

Joined: Thu Nov 29, 2007 2:33 pm
Posts: 50
Entar wrote:
Any ideas?


Nope.

But if you are reluctant of using qmake, ill post here the Makefile it generated for me. It compiles static library, and works like a charm.

There is some Qt-specific stuff in it, but I think you can just remove it - the library does not depend on nor link with Qt in any way.
Good luck!


Attachments:
File comment: Renamed to Makefile.txt to get through forum defences.
Makefile.txt [21.87 KiB]
Downloaded 268 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group