Question

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

$ 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:

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 two places where LIBS variable was defined. But I still get the same error.

Était-ce utile?

La solution

I managed to fix this at last, after lots of searching and tweaking. This is what I did:

  1. Make sure you have the very latest version of premake. I had to install premake 4.4 (beta version).

  2. Compile and install the latest version of glfw (3.0.4 at the moment) from source. The version in Ubuntu's repositories does not work.

  3. Make sure you have glew and xorg development packages. I installed these from Ubuntu's repository: sudo apt-get install libglew-dev xorg-dev

  4. After running premake4 gmake in Box2D directory, go to Build/gmake and edit Testbed.make. Change the line LIBS += $(LDDEPS) -lX11 -lGL -lGLU -lglut into this LIBS += $(LDDEPS) -lX11 -lGL -lGLU -lglut -lGLEW -lglfw3 -lX11 -lXxf86vm -lpthread -lXrandr -lXi.

  5. Now run make.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top