Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTCreator Library Link Feature

QTCreator Library Link Feature

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 727 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Suths
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved