Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to link libraries like qxt or qwt?



  • Hi folks,

    I'm wondering how do Qxt and Qwt build their libraries so we can include later on like this
    @CONFIG += qxt
    QXT = core gui@

    I'm looking at the sources but I'm getting lost! Thanks.

    Edit: I'm diving into it and found about .prf files and the QtDir/mkspecs/features folder. What should I do when compiling my lib to place the .prf file so a user compiling my lib can use it in CONFIG?


  • Lifetime Qt Champion

    Hi,

    the prf files is the secret you are searching. Look in e.g. /usr/local/qwt-6.1.0-svn/features



  • Hi SGaist, thanks for the reply (funny, I've edited my answer just before you post).

    I'll dive more now I know about prf files. Thanks.


  • Lifetime Qt Champion

    You're welcome !

    You can find some information in qmake's documentation under "qmake Advance Usage" chapter "Adding New Configuration Features"



  • I've finally got it working, but I think I've found a bug:
    when I compile using Qt Creator, the make instruction doesn't include the headers and libs I've declared in my prf file.

    When I do inside the terminal (qmake & make) I can see the include headers and libs, and effectively builds fine.

    Should I report a bug?


  • Lifetime Qt Champion

    Did you update an environment variable on the console ? If so, the environment in QtCreator might be outdated so it doesn't reflect what you did



  • The problem is that the qmake I was using through terminal belongs to another Qt version. I didn't even know I had Qt5.0.2 along with Qt5.1.1, funny!


  • Lifetime Qt Champion

    Naughty phantom Qt install... :-D

    Glad you found out !


Log in to reply