I am trying to compile ROOT with CMake. When I enable the option -Dbuiltin_freetype=ON I get the following error
/local/v5-34-01/temp/lib/libfreetype.a(ftgzip.o): In function `ft_gzip_file_done':
ftgzip.c:(.text+0x161): undefined reference to `inflateEnd'
/local/v5-34-01/temp/lib/libfreetype.a(ftgzip.o): In function `ft_gzip_file_fill_output':
ftgzip.c:(.text+0x2c3): undefined reference to `inflate'
/local/v5-34-01/temp/lib/libfreetype.a(ftgzip.o): In function `ft_gzip_file_io':
ftgzip.c:(.text+0x353): undefined reference to `inflateReset'
/local/v5-34-01/temp/lib/libfreetype.a(ftgzip.o): In function `FT_Stream_OpenGzip':
ftgzip.c:(.text+0x5a9): undefined reference to `inflateInit2_'
collect2: ld returned 1 exit status
gmake[2]: *** [lib/libFTGL.so.5.34.01] Error 1
gmake[1]: *** [graf3d/ftgl/CMakeFiles/FTGL.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
On the same machine, same check out, I can compile with the standard makefiles (–enable-builtin-freetype). Could you fix it ?
I would have created a ticket but it seems that there is a migration ongoing…
In cmake/modules/SearchInstalledSoftware.cmake, if I add “-lz” to this line :
set(FREETYPE_LIBRARIES "-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -lfreetype -lz")
then it works. This is NOT a patch. I have no idea of the side effects but I thought it might help you.
Hi,
I understood. My patch works for 5.34.04 and later. Please remove the reference to mathtext in there to make it work for 5.34.01 or upgrade to 5.34.05.
I see. I have switched to 5.34.05. It explains why the patch file was not properly working and I had to apply by hand some changes. Now it works. Thank you for the patch and for committing it.
I just downloaded ROOT 5.34.06 and ran into the exact same problem described here upon compilation. The fix posted in this thread earlier works well - however, it still needs to be manually applied to the three files in question.