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. [SOLVED]Linking Internal library with VERSION tag
QtWS25 Last Chance

[SOLVED]Linking Internal library with VERSION tag

Scheduled Pinned Locked Moved General and Desktop
qt5librarylinkermingw
6 Posts 2 Posters 2.5k 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.
  • E Offline
    E Offline
    ExorcistInc
    wrote on 31 Mar 2015, 16:52 last edited by ExorcistInc 4 Jan 2015, 09:47
    #1

    Hi!

    I have dynamic library in my project. Let it be "SignalProcess". I added it to project with Qt Creator "Add library..." dialog
    Here what i got:

    win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../SignalProcess/release/ -lSignalProcess
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../SignalProcess/debug/ -lSignalProcess
    else:unix: LIBS += -L$$OUT_PWD/../SignalProcess/ -lSignalProcess
    
    INCLUDEPATH += $$PWD/../SignalProcess
    DEPENDPATH += $$PWD/../SignalProcess
    

    It works fine until adding VERSION = 0.5.0 to SignalProcess. After it, build ends with error:

    cannot find -lSignalProcess
    

    I am using Qt 5.4.1 with MinGW 4.9.1 32bit under Windows 8.1 x64

    How is it possible to fix this?

    1 Reply Last reply
    0
    • E Offline
      E Offline
      ExorcistInc
      wrote on 31 Mar 2015, 18:25 last edited by
      #2

      So, I found one solution:

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

      Unfortunately, for some reason, VER_MAJ is not setted, even if VERSION is setted.
      But, after adding VER_MAJ = 0 to .pro file, the application begins to compile.

      Could it be something better than this? And why VER_MAJ is not setted by qmake?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mcosta
        wrote on 31 Mar 2015, 21:15 last edited by
        #3

        Hi,

        according to the doc VER_MAJ is set only for lib projects

        Once your problem is solved don't forget to:

        • Mark the thread as SOLVED using the Topic Tool menu
        • Vote up the answer(s) that helped you to solve the issue

        You can embed images using (http://imgur.com/) or (http://postimage.org/)

        1 Reply Last reply
        0
        • E Offline
          E Offline
          ExorcistInc
          wrote on 1 Apr 2015, 09:35 last edited by ExorcistInc 4 Jan 2015, 09:36
          #4

          Thanks for reply!

          Than, if I have project with subdirs, where one is lib with

          TARGET = SignalProcess
          TEMPLATE = lib
          VERSION = 0.5.0
          

          And other is application, why

          win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../SignalProcess/release/ -lSignalProcess
          else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../SignalProcess/debug/ -lSignalProcess
          else:unix: LIBS += -L$$OUT_PWD/../SignalProcess/ -lSignalProcess
          
          INCLUDEPATH += $$PWD/../SignalProcess
          DEPENDPATH += $$PWD/../SignalProcess
          

          does not work? (ends with "cannot find -lSignalProcess" error)

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mcosta
            wrote on 1 Apr 2015, 09:40 last edited by
            #5

            HI,

            in Windows the major_version became part of the library name, so you need to specify it when you want link the library

            Once your problem is solved don't forget to:

            • Mark the thread as SOLVED using the Topic Tool menu
            • Vote up the answer(s) that helped you to solve the issue

            You can embed images using (http://imgur.com/) or (http://postimage.org/)

            1 Reply Last reply
            0
            • E Offline
              E Offline
              ExorcistInc
              wrote on 1 Apr 2015, 09:46 last edited by
              #6

              Ok, thank you!
              just a little bit confused, that qmake could not generate right makefile without support:)

              1 Reply Last reply
              0

              4/6

              1 Apr 2015, 09:35

              • Login

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