Open RobLoach opened 5 years ago
Hi @RobLoach
You may have forgot to recursively pull all git submodules, try the following:
git submodule update --init --recursive
Note that compiling dependencies is only needed when building with examples. If you need to build the library only, run cmake with -DBUILD_EXAMPLES:BOOL=OFF
.
Let me know if that helps.
That got a bit further!
[ 87%] Linking CXX executable example_nanovg_backend_all
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_face_globals_new':
autofit.c:(.text+0x4747): undefined reference to `hb_ft_font_create'
autofit.c:(.text+0x4757): undefined reference to `hb_buffer_create'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_face_globals_free':
autofit.c:(.text+0x48bf): undefined reference to `hb_font_destroy'
autofit.c:(.text+0x48cf): undefined reference to `hb_buffer_destroy'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_shaper_get_coverage':
autofit.c:(.text+0xf68a): undefined reference to `hb_font_get_face'
autofit.c:(.text+0xf6eb): undefined reference to `hb_ot_tags_from_script'
autofit.c:(.text+0xf74b): undefined reference to `hb_set_create'
autofit.c:(.text+0xf777): undefined reference to `hb_ot_layout_collect_lookups'
autofit.c:(.text+0xf783): undefined reference to `hb_set_is_empty'
autofit.c:(.text+0xf790): undefined reference to `hb_set_create'
autofit.c:(.text+0xf7c9): undefined reference to `hb_ot_layout_lookup_collect_glyphs'
autofit.c:(.text+0xf7e0): undefined reference to `hb_set_next'
autofit.c:(.text+0xf7e9): undefined reference to `hb_set_create'
autofit.c:(.text+0xf815): undefined reference to `hb_ot_layout_collect_lookups'
autofit.c:(.text+0xf81a): undefined reference to `hb_set_create'
autofit.c:(.text+0xf853): undefined reference to `hb_ot_layout_lookup_collect_glyphs'
autofit.c:(.text+0xf86a): undefined reference to `hb_set_next'
autofit.c:(.text+0xf98d): undefined reference to `hb_ot_layout_lookup_would_substitute'
autofit.c:(.text+0xf9aa): undefined reference to `hb_set_next'
autofit.c:(.text+0xf9ff): undefined reference to `hb_set_subtract'
autofit.c:(.text+0xfa6c): undefined reference to `hb_set_next'
autofit.c:(.text+0xfa85): undefined reference to `hb_set_destroy'
autofit.c:(.text+0xfa91): undefined reference to `hb_set_destroy'
autofit.c:(.text+0xfa9d): undefined reference to `hb_set_destroy'
autofit.c:(.text+0xfaa9): undefined reference to `hb_set_destroy'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_shaper_buf_create':
autofit.c:(.text+0xfad5): undefined reference to `hb_buffer_create'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_shaper_buf_destroy':
autofit.c:(.text+0xfaf3): undefined reference to `hb_buffer_destroy'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_shaper_get_cluster':
autofit.c:(.text+0xfb98): undefined reference to `hb_font_set_scale'
autofit.c:(.text+0xfc6e): undefined reference to `hb_buffer_clear_contents'
autofit.c:(.text+0xfc8c): undefined reference to `hb_buffer_add_utf8'
autofit.c:(.text+0xfc98): undefined reference to `hb_buffer_guess_segment_properties'
autofit.c:(.text+0xfcb7): undefined reference to `hb_shape'
autofit.c:(.text+0xfcde): undefined reference to `hb_buffer_clear_contents'
autofit.c:(.text+0xfcfc): undefined reference to `hb_buffer_add_utf8'
autofit.c:(.text+0xfd08): undefined reference to `hb_buffer_guess_segment_properties'
autofit.c:(.text+0xfd22): undefined reference to `hb_shape'
autofit.c:(.text+0xfd35): undefined reference to `hb_buffer_get_glyph_infos'
autofit.c:(.text+0xfd4c): undefined reference to `hb_buffer_get_glyph_infos'
autofit.c:(.text+0xfdc4): undefined reference to `hb_buffer_clear_contents'
autofit.c:(.text+0xfdd0): undefined reference to `hb_buffer_get_length'
FREETYPE2-prefix/src/FREETYPE2-build/libfreetype.a(autofit.c.o): In function `af_shaper_get_elem':
autofit.c:(.text+0xfe3a): undefined reference to `hb_buffer_get_glyph_infos'
autofit.c:(.text+0xfe51): undefined reference to `hb_buffer_get_glyph_positions'
collect2: error: ld returned 1 exit status
CMakeFiles/example_nanovg_backend_all.dir/build.make:100: recipe for target 'example_nanovg_backend_all' failed
make[2]: *** [example_nanovg_backend_all] Error 1
CMakeFiles/Makefile2:403: recipe for target 'CMakeFiles/example_nanovg_backend_all.dir/all' failed
make[1]: *** [CMakeFiles/example_nanovg_backend_all.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Would like to try building the examples.
Ahhhh, CMake recognised your OS has HarfBuzz installed, but is missing when linking. FreeType automatically looks for it and adds it.
You can fix it by adding -DWITH_HarfBuzz=OFF
to FreeType cmake args.
Change this line https://github.com/matusnovak/finegui/blob/master/ExternalLibs.cmake#L85 to the following:
CMAKE_ARGS -DWITH_HarfBuzz=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true
I am currently cleaning up the files, adding some more examples, and fixing some issues such as this one. Will be pushing some changes in a day or two, so these kind of problems won't happen.
After running the following, the error occurs...