Author Topic: Cant compile 2.5.1 from source Ubuntu bionic  (Read 672 times)

lefty420

  • Newbie
  • *
  • Posts: 8
    • View Profile
Cant compile 2.5.1 from source Ubuntu bionic
« on: January 28, 2019, 05:00:03 AM »
Hi guys I'm trying to compile 2.5.1 from git source but its returning errors. 2.5.0 compiles and installs fine.
Any advice?

lefty@steambox:~/dev/attract/attract$ make -j $(cat /proc/cpuinfo | grep -c processor)
flags: -Wl,--export-dynamic -I/usr/include/freetype2 -I/usr/include/libpng16 -DDATA_PATH=\"/usr/local/share/attract/\" -O2 -DNDEBUG -Iextlibs/audio/include -D__STDC_CONSTANT_MACROS -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/AL -I/usr/include/x86_64-linux-gnu -Iextlibs/squirrel/include -Iextlibs/sqrat/include -Iextlibs/nowide -Iextlibs/gameswf  -DUSE_XLIB -DUSE_XINERAMA -DUSE_FONTCONFIG -DUSE_LIBARCHIVE -DUSE_LIBCURL -DUSE_SWRESAMPLE
Compiling obj/fe_cmdline.o...
Compiling obj/fe_presentable.o...
Compiling obj/sprite.o...
Compiling obj/fe_present.o...
In file included from /usr/include/GL/gl.h:2055:0,
                 from /usr/include/SFML/OpenGL.hpp:54,
                 from src/fe_cmdline.cpp:34:
/usr/include/GL/glext.h:467:10: fatal error: KHR/khrplatform.h: No such file or directory
 #include <KHR/khrplatform.h>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:456: recipe for target 'obj/fe_cmdline.o' failed
make: *** [obj/fe_cmdline.o] Error 1
make: *** Waiting for unfinished jobs....

Namachieli

  • Full Member
  • ***
  • Posts: 33
    • View Profile
Re: Cant compile 2.5.1 from source Ubuntu bionic
« Reply #1 on: January 28, 2019, 05:25:23 PM »
Hi, I'm running on KDE Neon 18.04 (Basically the same thing).

You might be missing some build dependencies, on a fresh system this is from my personal build/deploy script.


# Install core build dependencies
sudo apt-get -q -y install ssh git gcc make build-essential

# Attract Mode Dependencies
sudo apt-get -q -y install libsfml-dev libopenal-dev libavformat-dev libfontconfig1-dev \
                           libfreetype6-dev libswscale-dev libavresample-dev libarchive-dev \
                           libjpeg-dev libglu1-mesa-dev

# Clone, compile, and install Attract Mode
git clone https://github.com/mickelson/attract.git ~/git/attract
cd ~/git/attract
make -j 3
sudo make install
cd ~
Neon 18.04 x64. i5 4690k, 16 GB RAM, EVGA GTX 750ti, DS3 SIXAXIS via BT/USB, RetroArch/libretro.

rcampbel3

  • Jr. Member
  • **
  • Posts: 13
    • View Profile
Re: Cant compile 2.5.1 from source Ubuntu bionic
« Reply #2 on: January 29, 2019, 03:52:00 PM »
In file included from /usr/include/GL/gl.h:2055:0,
                 from /usr/include/SFML/OpenGL.hpp:54,
                 from src/fe_cmdline.cpp:34:
/usr/include/GL/glext.h:467:10: fatal error: KHR/khrplatform.h: No such file or directory
 #include <KHR/khrplatform.h>
          ^~~~~~~~~~~~~~~~~~~
I know that compile errors in the terminal can look like scary gobbledygook, but... they actually contain important information. A piece of advice -- start at the bottom of compile error messages and work up until you find the real problem.

In this case, the problem is that khrplatform.h doesn't exist on your system.

.h files are header files that contain information required when trying to compile using a given library. Most linux package management systems split library packages into the runtime component and the bits necessary to compile from scratch. These "development" packages almost always end in "-dev". In this case, you can clearly see that there's an OpenGL library dependency that's not installed.

Now, google for "KHR/khrplatform.h ubuntu", and you can see that the missing package name is 'libegl1-mesa-dev'

So... add it as follows:

sudo apt-get install libegl1-mesa-dev

then try compiling again. If you hit another missing package, repeat!

Namachieli

  • Full Member
  • ***
  • Posts: 33
    • View Profile
Re: Cant compile 2.5.1 from source Ubuntu bionic
« Reply #3 on: January 29, 2019, 10:06:21 PM »
I know that compile errors in the terminal can look like scary gobbledygook, but... they actually contain important information. A piece of advice -- start at the bottom of compile error messages and work up until you find the real problem.

Well said.
Neon 18.04 x64. i5 4690k, 16 GB RAM, EVGA GTX 750ti, DS3 SIXAXIS via BT/USB, RetroArch/libretro.

lefty420

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Cant compile 2.5.1 from source Ubuntu bionic
« Reply #4 on: January 30, 2019, 03:45:07 AM »
Thanks guys! I will give it a go and report back very much appreciate the help !

stevereaver

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Cant compile 2.5.1 from source Ubuntu bionic
« Reply #5 on: February 22, 2019, 08:56:45 PM »
I'm on KDENEON 18.04 as well, isn't that lucky!

A good technique to use when compiling and there is an error saying a file is missing to to use apt-file like this;

Code: [Select]
reaver@travella:~$ apt-file search khrplatform.h
emscripten: /usr/share/emscripten/system/include/KHR/khrplatform.h
libegl1-mesa-dev: /usr/include/KHR/khrplatform.h
libogre-1.9-dev: /usr/include/OGRE/RenderSystems/GLES2/KHR/khrplatform.h
libsdl2-dev: /usr/include/SDL2/SDL_opengles2_khrplatform.h
python-kivy: /usr/lib/python2.7/dist-packages/kivy/graphics/khrplatform.h
python3-kivy: /usr/lib/python3/dist-packages/kivy/graphics/khrplatform.h
thunderbird-dev: /usr/include/thunderbird/angle/KHR/khrplatform.h

Then you can see which file it is after, and which package it belongs to. So now you can use; 

Code: [Select]
sudo apt-get install libegl1-mesa-dev