Undefined symbols when linking on Linux

I'm trying building Box2d v2.3.1 on my Ubuntu (13.10) machine. This is what I'm doing:

Code: Select all

$ premake4 gmake
$ cd Build/gmake/
$ make

But the testbed is not building correctly. I get lots of undefined reference errors for glfw and glew symbols, like this:

Code: Select all

obj/Debug/Testbed/Main.o: In function `main':
/home/mostafa/.adobe/box2d-2.3.1/Box2D/Build/gmake/../../Testbed/Framework/Main.cpp:458: undefined reference to `glfwCreateWindow'

I have the development packages for both glfw and glew installed. I also checked the Testbed.make makefile and, since I saw no reference to glfw, added -lglfw to the LIBS variable. But I still get the same error.

If anyone has any ideas how I can fix this, I'll be extremely grateful.
Okay, I fixed this myself and documented it here:

http://majstrprogramisto.blogspot.com/2 ... linux.html

I'd say the build system is broken and documentation woefully lacking, at least for Linux. I have no experience with premake, otherwise I would volunteer to fix this myself. Hopefully someone would come along and fix this.

Anyway, I finally managed to compile everything and run the testbed. This is cool! Now I'd better go and see what I can do with it.

EDIT: I also answered my own question about this on Stack Overflow, which is more coherent and easier to follow: http://stackoverflow.com/questions/2367 ... nker-error

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