Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Creating and adding a static library

Creating and adding a static library

Scheduled Pinned Locked Moved 3rd Party Software
3 Posts 2 Posters 6.3k 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.
  • R Offline
    R Offline
    ras123
    wrote on 30 Apr 2011, 17:18 last edited by
    #1

    Hi,
    I am using qt on windows now. I need to add the serial port library (http://code.google.com/p/qextserialport/source/checkout). First I build the library using the CONFIG += staticlib option and get a library with an extension with .a .Now I try to add the library to some example programs given in the event directory. I also add CONFIG += staticlib in the .pro file, but I always get errors like
    @qextserialport\examples\event-build-desktop/../event/PortListener.cpp:11: undefined reference to `_imp___ZN14QextSerialPort9setParityE10ParityType'@

    I think there is some linking issues, because it will work when linking with dll files, how to solve?

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on 30 Apr 2011, 18:48 last edited by
      #2

      Please post your .pro file for the project that is not linking properly and could you let us know where the statically compiled library is located please?

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • R Offline
        R Offline
        ras123
        wrote on 1 May 2011, 01:56 last edited by
        #3

        Hi,
        Here is the complete project code (http://www.4shared.com/file/FFtrqBMR/qextserialport.html ), in which I tried the project in the examples/event folder, i.e

        @
        PROJECT = event
        TEMPLATE = app
        DEPENDPATH += .
        INCLUDEPATH += ../../src
        QMAKE_LIBDIR += ../../src-build-desktop/build
        CONFIG += staticlib

        OBJECTS_DIR = tmp
        MOC_DIR = tmp
        UI_DIR = tmp

        SOURCES += main.cpp PortListener.cpp
        HEADERS += PortListener.h

        CONFIG(debug, debug|release):LIBS += -lqextserialportd
        else:LIBS += -lqextserialport
        @
        I am using Qt libraries version 4.7.0, Qt Creator IDE version 2.0.1 in Windows
        Thanking You,
        Ras

        1 Reply Last reply
        0

        1/3

        30 Apr 2011, 17:18

        • Login

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