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
Qt 6.11 is out! See what's new in the release blog

Creating and adding a static library

Scheduled Pinned Locked Moved 3rd Party Software
3 Posts 2 Posters 7.2k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on 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
    • ? Offline
      ? Offline
      A Former User
      wrote on 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?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on 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

        • Login

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