Undefined symbols for architecture x86_64

Mark Brethen mark.brethen at gmail.com
Mon Sep 17 14:13:50 UTC 2018


I remember seeing in the developer’s documentation that he specifically wanted to link to the static library. At the time this was coded (~2016) there was a bug in the fontconfig port not supplying the static library so he supplied one. I asked him to remove it, since that issue has been fixed in the current port.

Sent from my iPhone

> On Sep 17, 2018, at 8:58 AM, Ryan Schmidt <ryandesign at macports.org> wrote:
> 
> 
> 
>> On Sep 17, 2018, at 08:33, Mark Brethen wrote:
>> 
>> I’m getting the following error when trying to build current snapshot of reduce-csl:
>> 
>> 
>> :info:build Undefined symbols for architecture x86_64:
>> :info:build   "_libintl_dgettext", referenced from:
>> :info:build       _FcConfigFileInfoIterGet in libfontconfig.a(fccfg.o)
>> :info:build ld: symbol(s) not found for architecture x86_64
>> :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
>> :info:build make[3]: *** [csl] Error 1
>> :info:build make[2]: *** [all] Error 2
>> 
>> gettext @0.19.8.1_0
>> fontconfig @2.13.1_0 are installed.
> 
> Let's see. FcConfigFileInfoIterGet is a fontconfig function, and it is apparently using libintl_dgettext which is a gettext function, and it is presumably undefined because the gettext library (libintl) has not been included on the link line.
> 
> You could try adding "-lintl" to configure.ldflags when you build reduce-csl and see if that helps.
> 
> If I run "pkg-config fontconfig --libs" I see "-L/opt/local/lib -lfontconfig -lfreetype" -- it doesn't mention "-lintl". If fontconfig requires libintl, then that's a bug in fontconfig's fontconfig.pc file.
> 
> It looks like you might be linking with the fontconfig static library (libfontconfig.a); if so, try linking with the dynamic library (libfontconfig.dylib) instead; maybe that solves the problem too, and if so, that would be the preferred solution. On macOS and in MacPorts we prefer dynamic linking over static linking.
> 


More information about the macports-dev mailing list