1

I've been trying to install Box2D via cmake -> make

Sorry that this is so long, AT THE END IS A TL;DR !!

EDIT about 3 months or so later, I solved it (i think) per accident | See after TL;DR

Heres what I did: First off, downloaded Box2D from the gitHub repository, unzipped and moved it to a convenient location, opened the Build directory via the terminal. Then used

cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON ..

, just like the Building.txt told me to, and it worked fine. Then wanted to

make

but got 87% through an Error in the internal.h file:

"#error "No supported window creation API selected"

After looking at where it came from, I found that internal.h was checking if I used either the win32, cocoa or x11 platform:

#if defined(_GLFW_COCOA)
 #include "cocoa_platform.h"
#elif defined(_GLFW_WIN32)
 #include "win32_platform.h"
#elif defined(_GLFW_X11)
 #include "x11_platform.h"
#else
 #error "No supported window creation API selected"
#endif

Because I installed other libraries with dependencies on xorg, and these seem to work just fine, I forced it to use x11_platform.h (via defining _GLFW_X11 in a provided config.h file.).

Then ran the make command a second time. Next Error would be in the x11_platform.h file:

"#error "No supported context creation API selected"

It seemed to be pretty much the same as above, just with GLX and EGL:

#if defined(_GLFW_GLX)
 #define _GLFW_X11_CONTEXT_VISUAL window->glx.visual
 #include "glx_platform.h"
#elif defined(_GLFW_EGL)
 #define _GLFW_X11_CONTEXT_VISUAL window->egl.visual
 #define _GLFW_EGL_NATIVE_WINDOW  window->x11.handle
 #define _GLFW_EGL_NATIVE_DISPLAY _glfw.x11.display
 #include "egl_platform.h"
#else
 #error "No supported context creation API selected"
#endif

This time I did a bit of research on what the heck these are supposed to be (and checked if I had these mesa thingys for egl). As it seems, people say egl is the future. So I defined _GLFW_EGL in the config.h file.

Yeah, you guessed it, next Error. This time even fatal D: In egl_platform.h (I actually tried using GLX after this error, same thing)

"fatal error: ../deps/EGL/eglext.h: No such file or directory"

I then searched my computer for a eglext.h, and found one in my /usr/include/EGL

So I edited the Box2D/glfw/egl_platform.h file, theres actually a note that I maybe would have to change the path of the eglext.h thing. So I did.

#include "/usr/include/EGL/eglext.h"

And this make, it actually got to 100% !!! But then this happened: http://pastebin.com/bS2qY2KC And I have NO f*ing clue what this is supposed to mean... All I understand is that some functions are calling some things in a libglfw.a that they cant read. I checked if I even have this libglfw.a file, indeed I do under /usr/lib/x86_64-linux-gnu. I searched around a bit, and got the idea that my glfw package I got through apt-get may be outdated/ broken, so I removed it and installed glfw manually from https://github.com/glfw/glfw

TL;DR:

Basically i got this while building Box2D: [see the pastebin above, for some stupid reason I am not allowed to post more than 2 links]

I have no clue what this should tell me. I saw that there is libglfw.a popping up all over the place, so I completely reinstalled glfw (manually) using its gitHub files. Still exactly the same.

I would be extremely thankful if there was someone who could tell me what is going on there.

EDIT: Here's how I managed to install it via cmake (as I tried above...): In the Build directory:

cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DBOX2D_BUILD_STATIC=OFF -DBOX2D_BUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON ..
sudo make
make install
encomiastical
  • 143
  • 13
  • I have the same problem, but no answer – Prokop Hapala Jan 09 '16 at 16:48
  • Yeah, couldn't solve it I'm afraid. But as it turns out, there's a package on launchpad [https://launchpad.net/ubuntu/+source/box2d] and it seems to work just fine... so if your on ubuntu, thats a way at least... – encomiastical Feb 02 '16 at 14:47
  • Possible duplicate of [Compiling Box2D Linux](https://stackoverflow.com/questions/42351640/compiling-box2d-linux). Got it working on Ubuntu 17.04: https://stackoverflow.com/questions/42351640/compiling-box2d-linux/46288300#46288300 – Ciro Santilli OurBigBook.com Sep 18 '17 at 21:21

1 Answers1

-2

Try this series of commands:

git clone https://github.com/flyover/Box2D

(cd Box2D && git submodule init && git submodule update --recursive)

(mkdir -p Build && cd Build && cmake .. && make && Testbed/Testbed)
Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146