Search code examples
macosfirebreathgpgme

Cant build Firebreath when including libgpgme


Undefined symbols for architecture x86_64:   "_libintl_dgettext", referenced from:
      _gpg_strerror in libgpg-error.a(libgpg_error_la-strerror.o)
      _gpg_strerror_r in libgpg-error.a(libgpg_error_la-strerror.o)
      _gpg_strsource in libgpg-error.a(libgpg_error_la-strsource.o) ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status

As stated by the question , When trying to build my firebreath project which requires libgpgme on MacOSX 10.6 using Xcode I get the error above. My include/search paths are valid since I can run the following command from the console and it works fine.

 g++ -o test test.cpp `gpgme-config --libs`

The output form the gpgme-config is -L/opt/local/lib -lgpgme -lassuan -lgpg-error. Not sure what other info is needed , comment and I will updated as needed.


Solution

  • Your problem is that you're building a universal binary for both 32 and 64 bit and the library you're including is not built for 64 bit. You can build i386 only by adding -D CMAKE_OSX_ARCHITECTURES="i386" to your prepmac.sh command-line.

    Make sure to delete your build directory before running prepmac.sh with the new argument or it may not take.

    See the Prep Scripts page on firebreath.org for more info.