ultralight-ux / Ultralight

Lightweight, high-performance HTML renderer for game and app developers.
https://ultralig.ht
4.69k stars 197 forks source link

Dependency issues under Ubuntu 20.04 #356

Open somefoo opened 3 years ago

somefoo commented 3 years ago

There are problems when trying to compile the samples under Ubuntu 20.04 (because of old dependencies).

To reproduce:

# Install requirements
# Clone repo and enter it
mkdir build
cd build
cmake ..
cmake --build . --config Release

Here is an extraction of the error:

[ 45%] Linking CXX executable Sample1
/usr/bin/ld: warning: libpng12.so.0, needed by /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libffi.so.6, needed by /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_interlace_handling@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_create_write_struct@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_get_color_type@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_write_end@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_compression_level@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_add_alpha@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_get_IHDR@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0: undefined reference to `ffi_type_float'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_palette_to_rgb@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_process_data@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0: undefined reference to `ffi_type_sint64'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_write_image@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0: undefined reference to `ffi_type_pointer'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_write_info@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_read_update_info@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0: undefined reference to `ffi_type_sint32'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_write_fn@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0: undefined reference to `ffi_type_uint64'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_filter@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_gray_1_2_4_to_8@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_destroy_info_struct@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0: undefined reference to `ffi_type_void'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_create_info_struct@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0: undefined reference to `ffi_type_uint32'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_get_io_ptr@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0: undefined reference to `ffi_call'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_get_bit_depth@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_destroy_write_struct@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0: undefined reference to `ffi_type_double'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgobject-2.0.so.0: undefined reference to `ffi_prep_cif'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_destroy_read_struct@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_create_read_struct@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_error@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_swap@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_gray_to_rgb@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_progressive_read_fn@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_progressive_combine_row@PNG12_0'
/usr/bin/ld: /tmp/Ultralight/build/SDK/bin/libgstreamer-full-1.0.so: undefined reference to `png_set_IHDR@PNG12_0'
collect2: error: ld returned 1 exit status
make[2]: *** [samples/Sample 1 - Render to PNG/CMakeFiles/Sample1.dir/build.make:84: samples/Sample 1 - Render to PNG/Sample1] Error 1
make[1]: *** [CMakeFiles/Makefile2:466: samples/Sample 1 - Render to PNG/CMakeFiles/Sample1.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
joseluis commented 3 years ago

I have the same problem. In my case I solved the missing libpng12.so.0 by following this instructions.

And the missing libffi.so.6 by creating a symlink:

sudo ln -s /usr/lib/x86_64-linux-gnu/libffi.so /usr/local/lib/libffi.so.6
sudo ldconfig
somefoo commented 3 years ago

Hmm, I wouldn't suggest adding symlinks like that for shared libs, this can cause pretty funny problems down the line if you forget about the existence of it. I suggest you use project-local symlinks and use LD_LIBRARY_PATH or LD_PRELOAD to ensure your system stays healthy :)

PowerOfCreation commented 3 years ago

I have this issue on Ubuntu and Suse and I even have it on machines where I could compile Ultralight before, but now all of the sudden it is broken, because the newest Ultralight Release has those dependencies.

adamjs commented 3 years ago

Latest SDK has some fixes that should resolve this issue.

You can grab latest bins here: https://github.com/ultralight-ux/Ultralight#getting-the-latest-sdk