Qt 5.5 - XCode building failed - Linking failed - Poppler



  • This post is deleted!

  • Lifetime Qt Champion

    Hi,

    Something's a bit strange here, it seems it's using OS X Qt version (clang_64) and not the iOS version.



  • Yes, I solved the problem by updating Xcode and OS X. Then, I check my path env for pointing to qt/5.../ios/.... and it's good now.

    CMake works fine but XCodebuild doesn't, its seems that there is a file not found :

    "nspr.h file not found" when I try to build the project for iOS on XCode :/

    I'm close to goal, maybe I will write something about the compilation of Poppler for iOS & Android when it will be done, if it is ..

    EDIT :

    I have never use XCode but it is very simple to add libraries in the project. Now, it's almost good.

    Just a problem of linker that I must solve.


  • Lifetime Qt Champion

    What linker problem ?



  • Here is my error, not very helpful I find :

    Ld build.ios/qt5/src/poppler.build/Debug-iphoneos/poppler-qt5.build/Objects-normal/arm64/libpoppler-qt5.1.6.0.dylib normal arm64
    
        cd /Users/dev/env/poppler/poppler-0.42.0
    
        export IPHONEOS_DEPLOYMENT_TARGET=9.3
    
        export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk -L/Users/dev/env/poppler/poppler-0.42.0/build.ios/qt5/src/Debug-iphoneos -F/Users/dev/env/poppler/poppler-0.42.0/build.ios/qt5/src/Debug-iphoneos -filelist /Users/dev/env/poppler/poppler-0.42.0/build.ios/qt5/src/poppler.build/Debug-iphoneos/poppler-qt5.build/Objects-normal/arm64/poppler-qt5.1.6.0.LinkFileList -install_name /libpoppler-qt5.1.6.0.dylib -miphoneos-version-min=9.3 -dead_strip -Xlinker -no_deduplicate -dynamiclib -Wl,-headerpad_max_install_names -install_name /Users/dev/env/poppler/poppler-0.42.0/build.ios/qt5/src/Debug-iphoneos/libpoppler-qt5.1.dylib /Users/dev/env/poppler/poppler-0.42.0/build.ios/Debug-iphoneos/libpoppler.59.0.0.dylib /Users/dev/env/qt-5.6/5.6/ios/lib/libQt5Core_debug.a /Users/dev/env/qt-5.6/5.6/ios/lib/libQt5Gui_debug.a /Users/dev/env/qt-5.6/5.6/ios/lib/libQt5Xml_debug.a /Users/dev/env/qt-5.6/5.6/ios/lib/libQt5Core_debug.a -single_module -compatibility_version 1.0.0 -current_version 1.6.0 -Xlinker -dependency_info -Xlinker /Users/dev/env/poppler/poppler-0.42.0/build.ios/qt5/src/poppler.build/Debug-iphoneos/poppler-qt5.build/Objects-normal/arm64/poppler-qt5.1.6.0_dependency_info.dat -o /Users/dev/env/poppler/poppler-0.42.0/build.ios/qt5/src/poppler.build/Debug-iphoneos/poppler-qt5.build/Objects-normal/arm64/libpoppler-qt5.1.6.0.dylib
    
     
    
    Undefined symbols for architecture arm64:
    
      "_inflateReset", referenced from:
    
          _png_inflate_claim in libQt5Gui_debug.a(pngrutil.o)
    
          _png_decompress_chunk in libQt5Gui_debug.a(pngrutil.o)
    
      "_inflateInit_", referenced from:
    
          _png_inflate_claim in libQt5Gui_debug.a(pngrutil.o)
    
      "_kCFTypeArrayCallBacks", referenced from:
    
          macList(QList<QVariant> const&) in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFArrayCreate", referenced from:
    
          macList(QList<QVariant> const&) in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFPropertyListCreateData", referenced from:
    
          QConfFileSettingsPrivate::writePlistFile(QString const&, QMap<QSettingsKey, QVariant> const&) const in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFURLCreateDataAndPropertiesFromResource", referenced from:
    
          QConfFileSettingsPrivate::readPlistFile(QString const&, QMap<QSettingsKey, QVariant>*) const in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFPropertyListCreateFromXMLData", referenced from:
    
          QConfFileSettingsPrivate::readPlistFile(QString const&, QMap<QSettingsKey, QVariant>*) const in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFNumberGetValue", referenced from:
    
          qtValue(void const*) in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFBooleanGetValue", referenced from:
    
          qtValue(void const*) in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFDataGetLength", referenced from:
    
          qtValue(void const*) in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFDictionaryGetKeysAndValues", referenced from:
    
          qtValue(void const*) in libQt5Core_debug.a(qsettings_mac.o)
    
          QConfFileSettingsPrivate::readPlistFile(QString const&, QMap<QSettingsKey, QVariant>*) const in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFDateGetTypeID", referenced from:
    
          qtValue(void const*) in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFDataCreate", referenced from:
    
          macValue(QVariant const&) in libQt5Core_debug.a(qsettings_mac.o)
    
      "_kCFTypeDictionaryValueCallBacks", referenced from:
    
          macValue(QVariant const&) in libQt5Core_debug.a(qsettings_mac.o)
    
          QConfFileSettingsPrivate::writePlistFile(QString const&, QMap<QSettingsKey, QVariant> const&) const in libQt5Core_debug.a(qsettings_mac.o)
    
      "_kCFAbsoluteTimeIntervalSince1970", referenced from:
    
          macValue(QVariant const&) in libQt5Core_debug.a(qsettings_mac.o)
    
          qtValue(void const*) in libQt5Core_debug.a(qsettings_mac.o)
    
      "_kCFBooleanFalse", referenced from:
    
          macValue(QVariant const&) in libQt5Core_debug.a(qsettings_mac.o)
    
      "_deflateInit2_", referenced from:
    
          _png_deflate_claim in libQt5Gui_debug.a(pngwutil.o)
    
      "_deflate", referenced from:
    
          _png_compress_IDAT in libQt5Gui_debug.a(pngwutil.o)
    
          _png_text_compress in libQt5Gui_debug.a(pngwutil.o)
    
      "_adler32", referenced from:
    
          _png_compare_ICC_profile_with_sRGB in libQt5Gui_debug.a(png.o)
    
      "_CFDictionaryCreate", referenced from:
    
          macValue(QVariant const&) in libQt5Core_debug.a(qsettings_mac.o)
    
          QConfFileSettingsPrivate::writePlistFile(QString const&, QMap<QSettingsKey, QVariant> const&) const in libQt5Core_debug.a(qsettings_mac.o)
    
      "AnnotPath::AnnotPath(AnnotCoord**, int)", referenced from:
    
          Poppler::AnnotationPrivate::toAnnotPath(QLinkedList<QPointF> const&) const in poppler-annotation.o
    
      "_CFBundleGetValueForInfoDictionaryKey", referenced from:
    
          QCoreApplicationPrivate::macMenuBarName() in libQt5Core_debug.a(qcoreapplication.o)
    
      "_CFBundleCopyExecutableURL", referenced from:
    
          QLibraryPrivate::load_sys() in libQt5Core_debug.a(qlibrary_unix.o)
    
      "_hb_blob_create", referenced from:
    
          _hb_qt_reference_table(hb_face_t*, unsigned int, void*) in libQt5Gui_debug.a(qharfbuzzng.o)
    
      "_CFURLGetFileSystemRepresentation", referenced from:
    
          QLibraryPrivate::load_sys() in libQt5Core_debug.a(qlibrary_unix.o)
    
      "AnnotCalloutMultiLine::AnnotCalloutMultiLine(double, double, double, double, double, double)", referenced from:
    
          Poppler::TextAnnotation::setCalloutPoints(QVector<QPointF> const&) in poppler-annotation.o
    
      "UnicodeMap::mapUnicode(unsigned int, char*, int)", referenced from:
    
          Poppler::unicodeToQString(unsigned int*, int) in poppler-private.o
    
      "_kCFLocaleAlternateQuotationBeginDelimiterKey", referenced from:
    
          macQuoteString(QSystemLocale::QueryType, QStringRef const&) in libQt5Core_debug.a(qlocale_mac.o)
    
      "FormWidgetText::isPassword() const", referenced from:
    
          Poppler::FormFieldText::isPassword() const in poppler-form.o
    
      "_pcre16_fullinfo", referenced from:
    
          QRegularExpressionPrivate::getPatternInfo() in libQt5Core_debug.a(qregularexpression.o)
    
      "_kCFLocaleAlternateQuotationEndDelimiterKey", referenced from:
    
          macQuoteString(QSystemLocale::QueryType, QStringRef const&) in libQt5Core_debug.a(qlocale_mac.o)
    
      "_CFDataGetBytePtr", referenced from:
    
          qtValue(void const*) in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFNumberFormatterCreate", referenced from:
    
          macFormatCurrency(QSystemLocale::CurrencyToStringArgument const&) in libQt5Core_debug.a(qlocale_mac.o)
    
      "AnnotRichMedia::Content::getAsset(int) const", referenced from:
    
          Poppler::AnnotationPrivate::findAnnotations(Page*, Poppler::DocumentData*, QSet<Poppler::Annotation::SubType> const&, int) in poppler-annotation.o
    
      "_CFNumberFormatterSetProperty", referenced from:
    
          macFormatCurrency(QSystemLocale::CurrencyToStringArgument const&) in libQt5Core_debug.a(qlocale_mac.o)
    
      "_CFNumberFormatterCreateStringWithNumber", referenced from:
    
          macFormatCurrency(QSystemLocale::CurrencyToStringArgument const&) in libQt5Core_debug.a(qlocale_mac.o)
    
      "_CFCalendarCopyCurrent", referenced from:
    
          macFirstDayOfWeek() in libQt5Core_debug.a(qlocale_mac.o)
    
      "TextWordList::~TextWordList()", referenced from:
    
          Poppler::Page::textList(Poppler::Page::Rotation) const in poppler-page.o
    
      "_CFTimeZoneCopyDefault", referenced from:
    
          macDateToString(QDate const&, bool) in libQt5Core_debug.a(qlocale_mac.o)
    
          macTimeToString(QTime const&, bool) in libQt5Core_debug.a(qlocale_mac.o)
    
      "_CFGregorianDateGetAbsoluteTime", referenced from:
    
          macDateToString(QDate const&, bool) in libQt5Core_debug.a(qlocale_mac.o)
    
          macTimeToString(QTime const&, bool) in libQt5Core_debug.a(qlocale_mac.o)
    
      "_CFDateCreate", referenced from:
    
          macDateToString(QDate const&, bool) in libQt5Core_debug.a(qlocale_mac.o)
    
          macTimeToString(QTime const&, bool) in libQt5Core_debug.a(qlocale_mac.o)
    
          macValue(QVariant const&) in libQt5Core_debug.a(qsettings_mac.o)
    
      "AnnotPolygon::AnnotPolygon(PDFDoc*, PDFRectangle*, Annot::AnnotSubtype)", referenced from:
    
          Poppler::LineAnnotationPrivate::createNativeAnnot(Page*, Poppler::DocumentData*) in poppler-annotation.o
    
      "_kCFDateFormatterMonthSymbols", referenced from:
    
          macMonthName(int, bool) in libQt5Core_debug.a(qlocale_mac.o)
    
      "_CFLocaleGetValue", referenced from:
    
          getCFLocaleValue(__CFString const*) in libQt5Core_debug.a(qlocale_mac.o)
    
          macMeasurementSystem() in libQt5Core_debug.a(qlocale_mac.o)
    
          macCurrencySymbol(QLocale::CurrencySymbolFormat) in libQt5Core_debug.a(qlocale_mac.o)
    
          macQuoteString(QSystemLocale::QueryType, QStringRef const&) in libQt5Core_debug.a(qlocale_mac.o)
    
      "Annot::decRefCnt()", referenced from:
    
          Poppler::AnnotationPrivate::~AnnotationPrivate() in poppler-annotation.o
    
      "AnnotCaret::AnnotCaret(PDFDoc*, PDFRectangle*)", referenced from:
    
          Poppler::CaretAnnotationPrivate::createNativeAnnot(Page*, Poppler::DocumentData*) in poppler-annotation.o
    
      "_OBJC_CLASS_$_NSBundle", referenced from:
    
          objc-class-ref in libQt5Core_debug.a(qstandardpaths_ios.o)
    
      "_kCFLocaleDecimalSeparator", referenced from:
    
          QSystemLocale::query(QSystemLocale::QueryType, QVariant) const in libQt5Core_debug.a(qlocale_mac.o)
    
      "GfxFont::readEmbFontFile(XRef*, int*)", referenced from:
    
          ArthurOutputDev::updateFont(GfxState*) in ArthurOutputDev.o
    
      "_kCFPreferencesCurrentUser", referenced from:
    
          QSystemLocale::query(QSystemLocale::QueryType, QVariant) const in libQt5Core_debug.a(qlocale_mac.o)
    
      "Movie::~Movie()", referenced from:
    
          Poppler::MovieData::~MovieData() in poppler-movie.o
    
      "_kCFPreferencesAnyHost", referenced from:
    
          QSystemLocale::query(QSystemLocale::QueryType, QVariant) const in libQt5Core_debug.a(qlocale_mac.o)
    
          ___cxx_global_var_init in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFDictionaryGetCount", referenced from:
    
          qtValue(void const*) in libQt5Core_debug.a(qsettings_mac.o)
    
          QConfFileSettingsPrivate::readPlistFile(QString const&, QMap<QSettingsKey, QVariant>*) const in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFPreferencesCopyValue", referenced from:
    
          QSystemLocale::query(QSystemLocale::QueryType, QVariant) const in libQt5Core_debug.a(qlocale_mac.o)
    
      "_CFURLWriteDataAndPropertiesToResource", referenced from:
    
          QConfFileSettingsPrivate::writePlistFile(QString const&, QMap<QSettingsKey, QVariant> const&) const in libQt5Core_debug.a(qsettings_mac.o)
    
      "_CFArrayGetCount", referenced from:
    
          QSystemLocale::query(QSystemLocale::QueryType, QVariant) const in libQt5Core_debug.a(qlocale_mac.o)
    
          qtValue(void const*) in libQt5Core_debug.a(qsettings_mac.o)
    
      "___CFConstantStringClassReference", referenced from:
    
          CFString in libQt5Core_debug.a(qcoreapplication.o)
    
          CFString in libQt5Core_debug.a(qcore_mac_objc.o)
    
          CFString in libQt5Core_debug.a(qlocale_mac.o)
    
      "PDFDoc::~PDFDoc()", referenced from:
    
          Poppler::DocumentData::~DocumentData() in poppler-private.o
    
      "_CFCopyTypeIDDescription", referenced from:
    
          QSystemLocale::query(QSystemLocale::QueryType, QVariant) const in libQt5Core_debug.a(qlocale_mac.o)
    
      "TextOutputDev::getText(double, double, double, double)", referenced from:
    
          Poppler::Page::text(QRectF const&, Poppler::Page::TextLayout) const in poppler-page.o
    
      "_CFDateFormatterGetFormat", referenced from:
    
          getMacDateFormat(CFDateFormatterStyle) in libQt5Core_debug.a(qlocale_mac.o)
    
          getMacTimeFormat(CFDateFormatterStyle) in libQt5Core_debug.a(qlocale_mac.o)
    
      "SplashFontEngine::loadCIDFont(SplashFontFileID*, SplashFontSrc*)", referenced from:
    
          ArthurOutputDev::updateFont(GfxState*) in ArthurOutputDev.o
      
    

    And there is more like that ...


  • Moderators

    Aren't you building for iOS?
    That:
    "Undefined symbols for architecture arm64:"
    means you're linking for X86_64!


  • Lifetime Qt Champion

    @Lordful Seems like you are not linking some base framework and libraries like libpng and CoreFoundation.

    @jsulm nop, it's not amd64 it's arm64 ;)



  • Yes I'm building for iOS. I will check what you said on monday.


  • Moderators

    @SGaist Yes , you're right. It looks so similar :-)



  • Hum I will try to add these two libs in the library field and see what I get.

    @SGaist It seems that QtCore & libpng are already inside of "Header Search Paths" inside of Poppler & Poppler-qt5


  • Lifetime Qt Champion

    The symbols that are missing comes from OS X/ iOS frameworks (e.g. CFArrayCreate) not Qt



  • @SGaist Hum I will check that, should I add the path to Core in library ? (Anyway, I will try)



  • @SGaist Isn't a problem of architecture ? It seems that XCode try to use some librarie which has been build for OS X and not for iOS.


  • Lifetime Qt Champion

    Did you apply the patch proposed in the bug report ? And re-configure / re-build the project ?

    Not seeing the linker output I don't know if it get the framework for the wrong architecture or if they are just missing from the linker options.



  • @SGaist Hum as I said earlier, it's no more a problem with gl.h but a problem on linking the two libraries.

    Actually, the compilation of Poppler succeed but the compilation of Poppler-Qt5 fail when XCode try to link the two libs.

    And before, I solved the problem of "gl.h" by downloading Qt 5.6 & check my path env to point to ios/bin.


  • Lifetime Qt Champion

    What about building it using Qt Creator just to ensure you use the right kit ?



  • @SGaist Yes I tried.

    But I can only run/compile for Desktop. When I try to add a Kit, if I choose to add a kit for iOS, there is no generator in CMake Wizard.

    So ... it's strange.



  • @SGaist I had update this topic and here is the actual error output from XCode when I try to build poppler-qt5 :

    ld: warning: -headerpad_max_install_names is ignored when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
    
    ld: warning: ignoring file /usr/local/Cellar/fontconfig/2.11.1_2/lib/libfontconfig.a, file was built for archive which is not the architecture being linked (arm64): /usr/local/Cellar/fontconfig/2.11.1_2/lib/libfontconfig.a
    
    ld: warning: ignoring file /usr/local/Cellar/freetype/2.6.3/lib/libfreetype.a, file was built for archive which is not the architecture being linked (arm64): /usr/local/Cellar/freetype/2.6.3/lib/libfreetype.a
    
    ld: warning: ignoring file /usr/local/Cellar/jpeg/8d/lib/libjpeg.a, file was built for archive which is not the architecture being linked (arm64): /usr/local/Cellar/jpeg/8d/lib/libjpeg.a
    
    ld: warning: ignoring file /usr/local/Cellar/nss/3.23/lib/libnss.a, file was built for archive which is not the architecture being linked (arm64): /usr/local/Cellar/nss/3.23/lib/libnss.a
    
    ld: warning: ignoring file /usr/local/Cellar/libpng/1.6.21/lib/libpng.a, file was built for archive which is not the architecture being linked (arm64): /usr/local/Cellar/libpng/1.6.21/lib/libpng.a
    
    ld: warning: ignoring file /usr/local/Cellar/libtiff/4.0.6/lib/libtiff.a, file was built for archive which is not the architecture being linked (arm64): /usr/local/Cellar/libtiff/4.0.6/lib/libtiff.a
    
    Undefined symbols for architecture arm64:
    
      "_CERT_DestroyCertificate", referenced from:
    
          SignatureHandler::validateCertificate() in SignatureHandler.o
    
      "_CERT_GetClassicOCSPEnabledSoftFailurePolicy", referenced from:
    
          SignatureHandler::validateCertificate() in SignatureHandler.o
    
      "_CERT_GetCommonName", referenced from:
    
          SignatureHandler::getSignerName() in SignatureHandler.o
    

    And there is more "referebced from" error. And this error appears when linking.


  • Lifetime Qt Champion

    How did you install Qt ?



  • @SGaist Simply by installing with Qt Unified Mac (dmg).

    Its seems to be a problem of lib, maybe ?

    I'm trying to compile Poppler for iOS in 2 steps :

    1. CMake
    2. XCode building

    But when you look at the error in XCode, it seems that lib aren't found. So weird.



  • @Lordful Hello , Did you managed to build Poppler for IOS ? I have been trying to do it for 2 days :(



  • @SGaist Lordful seems to have succeeded building Poppler with qt5 on ios . I could not hold the list of error I encountered.
    I am trying to build fontconfig , openjpeg and freetype for ios because they are asked in cmake. If I get to Xcode project it fails with different errors. I am new to Ios, and mac os . Should I build the dependencies from source for ios ? If so some of them are harder than poppler


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.