Hey
I was having major problems in getting Box2D to work. (Fixed them ... Just here to tell the tale )
This is what I had done -
I had initially downloaded the version 2.01 file available via SourceForge and tried to "make" it. Upon which I got an error that a certain memcopy function was not declared !! So I added the necessary header files in all the required files and again tried to "make" it. Then I got some other errors .. turns out I don't have GLUI and GLUT installed (Why do I need them .. I don't want the test bed! I just want the library ...)
So I installed those as well and retried. It compiled successfully, but there was not .a file in the library folder nor was there any HelloWorld example executable. And searching for some time I found this building page in the wiki which said I had to download a separate version for Linuxhttp://www.box2d.org/forum/download/file.php?id=365. (Basically I had been racking my brain for nothing !!)
Would it really be that bad to include a simple line in the readme "NOT FOR LINUX USERS - GOTO THIS PAGE ..." ? And If it's not meant for Linux users why in the world are there Makefiles. As far as I know (I could be wrong) they only work on Linux machines under normal circumstances.
Anyway after that I downloaded the "right" file and did the whole cmake and make thing. This time the .a file wasn't in the Library folder but it was in the Sources folder( Atleast it was there !! 🙂 ). After that I tried the next normal thing to do "make install" but that obviously didn't work (I mean why should such a basic thing be there !!)
Anyway then I tried compiling the basic HelloWorld program on my own and I got some "Missing Headers" file. Guess I had to manually add the location of the header files and the library during compilation. And then it finally worked !!
Now this isn't the normal was of compiling programs in Linux once we are done compiling the program usually we just do a "make install" and the files are sent to the appropriate place. Then during compilation we can just add a simple -lBox2D to the compiler settings and use a #include <Box2D.h> (Not "Box2D.h") and the library usually works fine.
In order to add that functionality I had to manually copy the "libBox2D.a" file in the /usr/lib/ folder and then move both the Box2D.h and the Sources folder to the /usr/include/ directory and manually edit the Box2D.h file to remove all the "../".
Examples ;-
This -------- #include "../Source/Common/b2Settings.h"
To ---------- #include "Source/Common/b2Settings.h"
And now all I have to do is add the -lBox2d.a to the compiler options and I'm done !!
Hope this helps people .. (This entire Process really frustrated me !!)
PS : Was just adding the link given in the wiki and I found this page :- http://www.box2d.org/wiki/index.php?tit ... with_Linux ... damn !! (Why did I not see that earlier !!)
I was having major problems in getting Box2D to work. (Fixed them ... Just here to tell the tale )
This is what I had done -
I had initially downloaded the version 2.01 file available via SourceForge and tried to "make" it. Upon which I got an error that a certain memcopy function was not declared !! So I added the necessary header files in all the required files and again tried to "make" it. Then I got some other errors .. turns out I don't have GLUI and GLUT installed (Why do I need them .. I don't want the test bed! I just want the library ...)
So I installed those as well and retried. It compiled successfully, but there was not .a file in the library folder nor was there any HelloWorld example executable. And searching for some time I found this building page in the wiki which said I had to download a separate version for Linuxhttp://www.box2d.org/forum/download/file.php?id=365. (Basically I had been racking my brain for nothing !!)
Would it really be that bad to include a simple line in the readme "NOT FOR LINUX USERS - GOTO THIS PAGE ..." ? And If it's not meant for Linux users why in the world are there Makefiles. As far as I know (I could be wrong) they only work on Linux machines under normal circumstances.
Anyway after that I downloaded the "right" file and did the whole cmake and make thing. This time the .a file wasn't in the Library folder but it was in the Sources folder( Atleast it was there !! 🙂 ). After that I tried the next normal thing to do "make install" but that obviously didn't work (I mean why should such a basic thing be there !!)
Anyway then I tried compiling the basic HelloWorld program on my own and I got some "Missing Headers" file. Guess I had to manually add the location of the header files and the library during compilation. And then it finally worked !!
Now this isn't the normal was of compiling programs in Linux once we are done compiling the program usually we just do a "make install" and the files are sent to the appropriate place. Then during compilation we can just add a simple -lBox2D to the compiler settings and use a #include <Box2D.h> (Not "Box2D.h") and the library usually works fine.
In order to add that functionality I had to manually copy the "libBox2D.a" file in the /usr/lib/ folder and then move both the Box2D.h and the Sources folder to the /usr/include/ directory and manually edit the Box2D.h file to remove all the "../".
Examples ;-
This -------- #include "../Source/Common/b2Settings.h"
To ---------- #include "Source/Common/b2Settings.h"
And now all I have to do is add the -lBox2d.a to the compiler options and I'm done !!
Hope this helps people .. (This entire Process really frustrated me !!)
PS : Was just adding the link given in the wiki and I found this page :- http://www.box2d.org/wiki/index.php?tit ... with_Linux ... damn !! (Why did I not see that earlier !!)