Hello. I noticed that "by default" when I compile fontconfig as a static library, then enable it in ffmpeg with --enable-fontconfig, I get these: /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcxml.o): In function `FcConfigMessage': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:504: undefined reference to `XML_GetCurrentLineNumber' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:507: undefined reference to `XML_GetCurrentLineNumber' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcxml.o): In function `FcConfigParseAndLoad': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:2928: undefined reference to `XML_ParserCreate' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:2940: undefined reference to `XML_SetUserData' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:2942: undefined reference to `XML_SetDoctypeDeclHandler' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:2943: undefined reference to `XML_SetElementHandler' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:2944: undefined reference to `XML_SetCharacterDataHandler' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:2950: undefined reference to `XML_GetBuffer' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:2967: undefined reference to `XML_ParseBuffer' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:2979: undefined reference to `XML_ParserFree' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:2970: undefined reference to `XML_GetErrorCode' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcxml.c:2970: undefined reference to `XML_ErrorString' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeUseNames': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2068: undefined reference to `FT_Has_PS_Glyph_Names' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeCheckGlyph': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2256: undefined reference to `FT_Load_Glyph' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeCharSetAndSpacingForSize': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2319: undefined reference to `FT_Select_Size' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2330: undefined reference to `FT_Select_Charmap' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2342: undefined reference to `FT_Get_Char_Index' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2455: undefined reference to `FT_Get_Glyph_Name' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2389: undefined reference to `FT_Get_First_Char' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2428: undefined reference to `FT_Get_Next_Char' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeCharIndex': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2202: undefined reference to `FT_Select_Charmap' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2212: undefined reference to `FT_Get_Char_Index' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeGlyphNameIndex': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2151: undefined reference to `FT_Get_Glyph_Name' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeCharSetAndSpacing': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2535: undefined reference to `FT_Get_Sfnt_Table' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeQueryFace': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1144: undefined reference to `FT_Get_Sfnt_Table' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1164: undefined reference to `FT_Get_Sfnt_Name_Count' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1188: undefined reference to `FT_Get_Sfnt_Name' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1391: undefined reference to `FT_Get_Sfnt_Table' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFontCapabilities': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:2705: undefined reference to `FT_Load_Sfnt_Table' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeQueryFace': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1495: undefined reference to `FT_Get_PS_Font_Info' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1649: undefined reference to `FT_Get_BDF_Property' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1670: undefined reference to `FT_Get_BDF_Property' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcGetPixelSize': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1034: undefined reference to `FT_Get_BDF_Property' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeQueryFace': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1530: undefined reference to `FT_Get_BDF_Property' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1537: undefined reference to `FT_Get_BDF_Property' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o):/home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1560: more undefined references to `FT_Get_BDF_Property' follow /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeQueryFace': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1495: undefined reference to `FT_Get_PS_Font_Info' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1709: undefined reference to `FT_Get_X11_Font_Format' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeQuery': /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1740: undefined reference to `FT_Init_FreeType' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1743: undefined reference to `FT_New_Face' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1752: undefined reference to `FT_Done_FreeType' /home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/win32/fontconfig-2.10.1/src/fcfreetype.c:1750: undefined reference to `FT_Done_Face' presumably, because it is running pkg-config like this: $ pkgconfig pkg-config --libs fontconfig which outputs: -L/home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib -lfontconfig after consulting the fontconfig people, they suggest this work around: $ pkg-config --static --libs fontconfig which outputs this: -L/home/rogerdpack/dev/ffmpeg-windows-build-helpers/builds/mingw-w64-i686/i686-w64-mingw32/lib -lfontconfig -lexpat -lfreetype and works. So the question is, if it would be possible to call it like that instead somehow? Anyway just wondering. Thanks! -r
Roger Pack <rogerdpack2 <at> gmail.com> writes:
I noticed that "by default" when I compile fontconfig as a static library, then enable it in ffmpeg with --enable-fontconfig,
[...]
it is running pkg-config like this:
$ pkgconfig pkg-config --libs fontconfig
which outputs:
-L/home/rogerdpack/..../i686-w64-mingw32/lib -lfontconfig
after consulting the fontconfig people, they suggest this work around: $ pkg-config --static --libs fontconfig
It is absolutely possible that I completely misunderstand how pkg-config is supposed to work, but imo pkg-config --libs should allow you to link to the library no matter how you configured it (or in other words: the pkg-config file of fontconfig has to look differently depending on how you configured fontconfig). Carl Eugen
It is absolutely possible that I completely misunderstand how pkg-config is supposed to work, but imo pkg-config --libs should allow you to link to the library no matter how you configured it (or in other words: the pkg-config file of fontconfig has to look differently depending on how you configured fontconfig).
Apparently nobody (including myself) really understand pkg-config. Here is an answer from fontconfig people:
I guess my only question mark here is "since I built fontconfig with --disable-shared --enable-static" would you say that fontconfig is still correct here?
AFAICT It's pkg-config's design no matter what the library has been built with.
I'm really not sure how FFmpeg is supposed to "know" it's linking against a static library, and thus know to pass the "--static" flag to pkg-config. Hmm... -r
Roger Pack <rogerdpack2 <at> gmail.com> writes:
the pkg-config file of fontconfig has to look differently depending on how you configured fontconfig).
Here is an answer from fontconfig people:
I guess my only question mark here is "since I built fontconfig with --disable-shared --enable-static" would you say that fontconfig is still correct here?
AFAICT It's pkg-config's design no matter what the library has been built with.
I don't think this is correct, see the usage of "$requires" in FFmpeg's configure file, in the section starting with "# build pkg-config files" Carl Eugen
Roger Pack in gmane.comp.video.ffmpeg.user (Tue, 18 Sep 2012 17:18:57 -0600):
Apparently nobody (including myself) really understand pkg-config.
I do not either...
Here is an answer from fontconfig people:
I guess my only question mark here is "since I built fontconfig with --disable-shared --enable-static" would you say that fontconfig is still correct here?
AFAICT It's pkg-config's design no matter what the library has been built with.
I'm really not sure how FFmpeg is supposed to "know" it's linking against a static library, and thus know to pass the "--static" flag to pkg-config.
I was having troubles today compiling fontconfig for Windows (cross compile on Ubuntu) and ran into the same errors as you. Finally Google pointed me to your remarks on this subject. I made a special pair of require_pkg_config() and check_pkg_config() functions for --enable-fontconfig in FFMpeg's configure, which did (for fontconfig only) nothing more than - pkg_libs=$($pkg_config --libs $pkg) + pkg_libs=$($pkg_config --static --libs $pkg) No more errors and finally a ffmpeg.exe that embeds subtitles in the video. Weird issue, but thanks for reporting this almost a year ago! Jan
Roger Pack in gmane.comp.video.ffmpeg.user (Tue, 18 Sep 2012 17:18:57 -0600):
Apparently nobody (including myself) really understand pkg-config.
Here is an answer from fontconfig people:
I guess my only question mark here is "since I built fontconfig with --disable-shared --enable-static" would you say that fontconfig is still correct here?
AFAICT It's pkg-config's design no matter what the library has been built with.
I'm really not sure how FFmpeg is supposed to "know" it's linking against a static library, and thus know to pass the "--static" flag to pkg-config.
To follow-up once again on this message: you can tell FFmpeg to use --static for all libraries. Just put "pkg_config='pkg-config --static'" at the beginning of your ./configure command-line. See http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=5&t=4&start=10#p2173 and http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=5&t=4&start=20#p5338 Take a look at man pkg-config as well. Jan
participants (3)
-
Carl Eugen Hoyos -
Jan Ehrhardt -
Roger Pack