ld: framework not found QtCore



  • Hi, I want to build poppler with qt5 (download from qt-project) on OS X 10.8, and met this linkage problem, what should I do next?

    Here is my steps,
    @export QTDIR="/Users/veiz/Qt5.1.0/5.1.0/clang_64"
    export POPPLER_QT5_CFLAGS=-I$QTDIR/include
    export POPPLER_QT5_CXXFLAGS=-I$QTDIR/include
    export POPPLER_QT5_TEST_CFLAGS=-I$QTDIR/include

    export POPPLER_QT5_LIBS="-L$QTDIR/lib -framework QtCore -framework QtGui -framework QtXml"
    export POPPLER_QT5_TEST_LIBS="-L$QTDIR/lib -framework QtCore -framework QtGui -framework QtXml"

    ./configure --enable-poppler-qt5
    make@


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Try replacing -L with -F



  • Thanks, now the error becomes “undefined symbols”

    @ CXXLD test-poppler-qt5
    Undefined symbols for architecture x86_64:
    "QApplication::exec()", referenced from:
    _main in test-poppler-qt5.o
    "QApplication::QApplication(int&, char**, int)", referenced from:
    _main in test-poppler-qt5.o
    "QApplication::~QApplication()", referenced from:
    _main in test-poppler-qt5.o
    "QLabel::QLabel(QString const&, QWidget*, QFlagsQt::WindowType)", referenced from:
    _main in test-poppler-qt5.o
    "QWidget::closeEvent(QCloseEvent*)", referenced from:
    vtable for PDFDisplayin test-poppler-qt5.o
    "QWidget::enterEvent(QEvent*)", referenced from:
    vtable for PDFDisplayin test-poppler-qt5.o
    <...skip...>
    ld: symbol(s) not found for architecture x86_64
    collect2: ld returned 1 exit status@


  • Lifetime Qt Champion

    You are missing the QtWidget framework



  • Yes, you are right! Now it working, and I can get the libpoppler-qt5.* libraries. Thanks man, you save my hours.



  • @SGaist Let's say someone is working directly with a Maya2017 specific version/flavor of QT and is getting this error. Would you have any insights? What would be the best option for installing (or not-missing) the QtWidget framework under this very specific circumstance. And if it's not too much to ask; pretend you're talking to someone who is using a Mac for the first time and has the computer literacy of a Windows programmer who knows nothing about QT to begin with - other than the C++ components.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    First of all, can you give me a bit more details about what you are currently developing for Maya ?



  • Oh thank you, I feel welcomed - and thanks for your quick reply too!

    I can't give too many details due to contracts which bind me. But I can tell you that it is all c++, much of it dynamic. The files were written a few years ago and right now my job is to bring them up to the current version(s) of Maya.

    I have the .pro file, Makefile.mac, resources and scripts folders, along with all the project code files in the proper directory. I also have QtWidgets in the location "/Applications/Autodesk/maya2017/include/qt-5.6.1-include".

    I don't know if this is all the relevant information you were looking for but I hope it helps.


  • Lifetime Qt Champion

    No worries, no need for that level of details.

    Then you likely need to do by hand what macdeployqt usually do when you want to deploy an application.

    Basically, call otool -L on your .dylib (I'm guessing you are creating a plugin for Maya). You'll then see all the dependencies of your plugin and where they are searched for.

    Run otool again on one of the plugin that's already provided with Maya just to see the paths used by them so you can follow the same logic for your own plugin.

    install_name_tool is then your friend because you can modify the path search for the dependencies of an application/library/plugin.

    Hope it helps



  • That looks like a sweet tool! If it works (heck, even if it doesn't) then this is the most helpful response anyone has ever received on the internet. I'll give it a go.



  • Totally abusing your help at this point, but you're responding to my questions.

    Looking through the files, there is no .dylib file. I don't know what environment this was originally made in so I don't know why there's no .dylib. I also ran

    "for f in ./*; do otool -L $f; done"

    hoping that I could brute-force some responses. Unfortunately, no dice... I guess the next step would be to look through the code files one-by-one and tabulate the dependencies myself. I don't know if there is just a better idea/option for me before I delve into such great lengths.


  • Lifetime Qt Champion

    Can you show a list of where it's currently failing ?


Log in to reply
 

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