Not able to build on Ubuntu

Hi!

I downloaded Box2D 2.2.1, cd:ed to
Code:
/home/matachi/Downloads/Box2D_v2.2.1/Build
and then I ran
Code:
cmake ..
,
Code:
make
and finally
Code:
sudo make install
.

sudo make install produced this output:
Code:
matachi:Build$ sudo make install
[ 42%] Built target Box2D
[ 43%] Built target HelloWorld
[ 65%] Built target freeglut_static
[ 96%] Built target glui
[100%] Built target Testbed
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/include/Box2D/Box2D.h
-- Installing: /usr/local/include/Box2D/Collision/b2BroadPhase.h
-- Installing: /usr/local/include/Box2D/Collision/b2Collision.h
-- Installing: /usr/local/include/Box2D/Collision/b2Distance.h
-- Installing: /usr/local/include/Box2D/Collision/b2DynamicTree.h
-- Installing: /usr/local/include/Box2D/Collision/b2TimeOfImpact.h
-- Installing: /usr/local/include/Box2D/Collision/Shapes/b2CircleShape.h
-- Installing: /usr/local/include/Box2D/Collision/Shapes/b2EdgeShape.h
-- Installing: /usr/local/include/Box2D/Collision/Shapes/b2ChainShape.h
-- Installing: /usr/local/include/Box2D/Collision/Shapes/b2PolygonShape.h
-- Installing: /usr/local/include/Box2D/Collision/Shapes/b2Shape.h
-- Installing: /usr/local/include/Box2D/Common/b2BlockAllocator.h
-- Installing: /usr/local/include/Box2D/Common/b2Draw.h
-- Installing: /usr/local/include/Box2D/Common/b2GrowableStack.h
-- Installing: /usr/local/include/Box2D/Common/b2Math.h
-- Installing: /usr/local/include/Box2D/Common/b2Settings.h
-- Installing: /usr/local/include/Box2D/Common/b2StackAllocator.h
-- Installing: /usr/local/include/Box2D/Common/b2Timer.h
-- Installing: /usr/local/include/Box2D/Dynamics/b2Body.h
-- Installing: /usr/local/include/Box2D/Dynamics/b2ContactManager.h
-- Installing: /usr/local/include/Box2D/Dynamics/b2Fixture.h
-- Installing: /usr/local/include/Box2D/Dynamics/b2Island.h
-- Installing: /usr/local/include/Box2D/Dynamics/b2TimeStep.h
-- Installing: /usr/local/include/Box2D/Dynamics/b2World.h
-- Installing: /usr/local/include/Box2D/Dynamics/b2WorldCallbacks.h
-- Installing: /usr/local/include/Box2D/Dynamics/Contacts/b2CircleContact.h
-- Installing: /usr/local/include/Box2D/Dynamics/Contacts/b2Contact.h
-- Installing: /usr/local/include/Box2D/Dynamics/Contacts/b2ContactSolver.h
-- Installing: /usr/local/include/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h
-- Installing: /usr/local/include/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h
-- Installing: /usr/local/include/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h
-- Installing: /usr/local/include/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h
-- Installing: /usr/local/include/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h
-- Installing: /usr/local/include/Box2D/Dynamics/Contacts/b2PolygonContact.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2DistanceJoint.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2FrictionJoint.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2GearJoint.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2Joint.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2MouseJoint.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2PrismaticJoint.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2PulleyJoint.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2RevoluteJoint.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2RopeJoint.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2WeldJoint.h
-- Installing: /usr/local/include/Box2D/Dynamics/Joints/b2WheelJoint.h
-- Installing: /usr/local/include/Box2D/Rope/b2Rope.h
-- Installing: /usr/local/lib/libBox2D.a
-- Installing: /usr/local/lib/Box2D/Box2D-targets.cmake
-- Installing: /usr/local/lib/Box2D/Box2D-targets-noconfig.cmake
-- Installing: /usr/local/lib/Box2D/Box2DConfig.cmake


Then in a project I included Box2D with:
Code:
#include <Box2D/Box2D.h>


And I added some Box2D lines to see if it would compile:
Code:
  b2World *m_world;
  b2Vec2 gravity;
  gravity.Set(0.0f, -10.0f);
  m_world = new b2World(gravity);


Then I tried to compile my project with:
Code:
matachi:allegro$ g++ -Wall main.cc components/*.cc systems/*.cc Artemis-Cpp/*.cpp `pkg-config --libs --static allegro-static-5.0` -L /usr/local/lib -I /usr/local/include


Which give me the following error:
Code:
main.cc: In function ‘int main(int, char**)’:
main.cc:50:12: warning: variable ‘m_world’ set but not used [-Wunused-but-set-variable]
/tmp/ccmRqltf.o: In function `main':
main.cc:(.text+0x22e): undefined reference to `b2World::b2World(b2Vec2 const&)'
collect2: error: ld returned 1 exit status


However, if I leave the include statement in the file and comment out the 4 other Box2D lines, it compiles fine. What am I missing here?
Don't you need -lBox2D to link?
Yeah, seems like that was what I were missing. Running the following works fine:
Code:
matachi:allegro$ g++ -Wall main.cc components/*.cc systems/*.cc Artemis-Cpp/*.cpp `pkg-config --libs --static allegro-static-5.0` -lBox2D -L/usr/local/lib -I/usr/local/include


However, I wonder, why doesn't pkg-config find it? Running the following returns nothing:
Code:
matachi:~$ pkg-config --list-all | grep ox2


While for an example, this work:
Code:
matachi:~$ pkg-config --list-all | grep allegro
allegro_main-static-5.0        allegro_main - Allegro game programming library, magic main addon
allegro_dialog-static-5.0      allegro_dialog - Allegro game programming library, native dialog addon
allegro_memfile-static-5.0     allegro_memfile - Allegro game programming library, memory files addon
allegro_audio-static-5.0       allegro_audio - Allegro game programming library, audio addon
allegro_ttf-static-5.0         allegro_ttf - Allegro game programming library, TrueType fonts addon
allegro-static-5.0             allegro - Allegro game programming library
allegro_primitives-static-5.0  allegro_primitives - Allegro game programming library, primitives addon
allegro_acodec-static-5.0      allegro_acodec - Allegro game programming library, audio codec addon
allegro_physfs-static-5.0      allegro_physfs - Allegro game programming library, PhysicsFS addon
allegro_font-static-5.0        allegro_font - Allegro game programming library, font addon
allegro_image-static-5.0       allegro_image - Allegro game programming library, image I/O addon
allegro_color-static-5.0       allegro_color - Allegro game programming library, colors addon

Original thread: https://box2d.org/forum/viewtopic.php?t=9056