Compilation in Ubuntu18.04
I found that the sources as they are do not compile any more in a current Linux. Using Ubunut18.04 Bionic, I found the following things have to be done to get it to compile. With those I could use the samples. Maybe its useful for someone
This was needed to compile gftl. It will create a static lib that will be linked later to svgl.
- Add README in the source folder. I change build.sh like that
cd glft
touch ../README
...
- The configure script failes with a check to an old and even unused function. Change the build/automate/files/configure.ac in line 150 like that
150 AC_CHECK_LIB(png,png_check_sig, [], ,...
150 AC_CHECK_LIB(png,png_sig_Cmp, [], ,...
With these changes I could run the script and compile gltf. With that the demos should work. I could start the demo with
env GLFT_FONTDIR=/usr/share/fonts/truetype/ttf-bitstream-very/ .simple
If that does not work, check for a different font folder on your system and try again.
After glft is compiled, this was needed to compile svgl itself
- install all dependencies. There is an additional dependency not listed, "GC", Bohm garbage collector. For Ubuntu 18.04 the following should cover the dependencies (the last two might be part of mesa-common)
sudo apt install libpng-dev
sudo apt install libexpat1-dev
sudo apt install mesa-common-dev
sudo apt install libgc-dev
sudo apt install libgl1-mesa-dev
sudo apt install libglu1-mesa-dev
- change the file src/svgl/ImageManager.cpp
+#include <string.h> //needed for memset()
# typedef struct png_struct_def png_struct; // comment out this line
-if (setjmp(png_ptr->jmpbuf)) { // replace line by
+if (setjmp(png_jmpbuf(png_ptr))) { // this line
-
Finally the configure needs the additional parameter "CPPFLAGS=-fpermissive"
-
To include a libr that is installed locally add with configure the option "--prefix=/home/
/ /svgl". This creates a structure with the SO-files and required header. You need to to the same for gftl above to get the required headers for gftl. The gftl lib is not required as its linked statically into the SO.
Thus, building svgl should work with
cd svgl-master
./build/automake/bootstrap
./configure CPPFLAGS=-fpermissive --prefix=--prefix=/home/test/libs/svgl
make
make install
Alternatively, it install in usr/local use this
cd svgl-master
./build/automake/bootstrap
./configure CPPFLAGS=-fpermissive
make
sudo make install