QTCreator Library Link Feature



  • Hi all,

    I have set up a QT project initially on Linux, where I have used QTCreator to create some dynamic libs. I wish to switch to Windows so have installed the latest QT distro (5.2.1), with VS2010. However I am getting a linker error on a library and can't work out why.

    Here is the library.pro File:
    @QT -= gui

    TARGET = Common
    TEMPLATE = lib
    DEFINES += COMMON_LIBRARY

    SOURCES +=
    some other files

    HEADERS +=
    Common_global.h
    some other files

    unix:!symbian {
    maemo5 {
    target.path = /opt/usr/lib
    } else {
    target.path = /usr/lib
    }
    INSTALLS += target
    }
    contains(QT, core): QT += concurrent
    contains(QT, gui): QT += widgets
    @

    and here is another library that I am attempting to link the common library to (where I have used the add library - > internal library feature).

    @
    TARGET = Interface
    TEMPLATE = lib

    DEFINES += INTERFACE_LIBRARY

    SOURCES +=
    #Some Files

    HEADERS +=
    Interface_global.h
    #Some Files

    unix:!symbian {
    maemo5 {
    target.path = /opt/usr/lib
    } else {
    target.path = /usr/lib
    }
    INSTALLS += target
    }

    win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../Core/release/ -lCore
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../Core/debug/ -lCore
    else:unix: LIBS += -L$$OUT_PWD/../Core/ -lCore

    INCLUDEPATH += $$PWD/../Core
    DEPENDPATH += $$PWD/../Core

    contains(QT, core): QT += concurrent
    contains(QT, gui): QT += widgets
    

    QMAKE_CXXFLAGS += -std=c++0x

    win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../Common/release/ -lCommon
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../Common/debug/ -lCommon
    else:unix: LIBS += -L$$OUT_PWD/../Common/ -lCommon

    INCLUDEPATH += $$PWD/../Common
    DEPENDPATH += $$PWD/../Common
    @

    The core Lib seems to Link ok


Log in to reply
 

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