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. Trouble with libraries built outside of Qt Creator
QtWS25 Last Chance

Trouble with libraries built outside of Qt Creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 632 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.
  • RandyHR Offline
    RandyHR Offline
    RandyH
    wrote on last edited by
    #1

    Hello,

    I have built my first app and am having some trouble. My app lets you browse for a file and then it does all sorts of magic after you select the file. I have several massive static libraries (about 4 gigs worth) that were built using Visual Studio 2013 that I am trying to use in my Qt project. It is not really feasible to try to rebuild this libraries in Qt Creator or add them in any way to my project.

    Everything runs perfectly fine in Qt Creator. I then used the windows deployment tool and got all the DLLs and the executable ran perfectly fine once again.

    But I absolutely must have (I am determined!) a single standalone executable. So I build static Qt and everything goes fine. I go to build the standalone executable and it appears to work fine even on a computer without Qt, I can open the app and it starts out good and I can browse for files. But as soon as I select a file and my library magic is about to happen, the program crashes!! I have static and dynamic versions of my libraries and I am using the correct versions! It has to be the way I am linking these, it has to be ultra simple but I can't figure it out!

    Here's my Test.pro file:

    RC_FILE = myapp.rc
    Target = Test
    Template = app
    
    #just the sources in my project Test.pro
    SOURCES += main.cpp\
                           file1.cpp\
                           file2.cpp
    
    #just the headers in my project Test.pro
    HEADERS+=file1.h\
                         file2.h
                         
    CONFIG += static
    
    FORMS +=mainwindow.ui
    RESOURCES+=resources.qrc
    
    #W is a mapped drive
    #W:/include is where my library headers "magic*.h" are
    INCLUDEPATH+= W:/include
    DEPENDPATH+=W:/include
    
    #W:/lib is where my libraries "magic*.lib" files are
    LIBS+=-L./W:/lib/ -lmagic1
    LIBS+=-L./W:/lib/ -lmagic2
    LIBS+=-L./W:/lib/ -lmagic3
    LIBS+=-L./W:/lib/ -lmagic4
    LIBS+=-L./W:/lib/ -lmagic5
    LIBS+=-L./W:/lib/ -lmagic6
    
    
    RandyHR 1 Reply Last reply
    0
    • RandyHR RandyH

      Hello,

      I have built my first app and am having some trouble. My app lets you browse for a file and then it does all sorts of magic after you select the file. I have several massive static libraries (about 4 gigs worth) that were built using Visual Studio 2013 that I am trying to use in my Qt project. It is not really feasible to try to rebuild this libraries in Qt Creator or add them in any way to my project.

      Everything runs perfectly fine in Qt Creator. I then used the windows deployment tool and got all the DLLs and the executable ran perfectly fine once again.

      But I absolutely must have (I am determined!) a single standalone executable. So I build static Qt and everything goes fine. I go to build the standalone executable and it appears to work fine even on a computer without Qt, I can open the app and it starts out good and I can browse for files. But as soon as I select a file and my library magic is about to happen, the program crashes!! I have static and dynamic versions of my libraries and I am using the correct versions! It has to be the way I am linking these, it has to be ultra simple but I can't figure it out!

      Here's my Test.pro file:

      RC_FILE = myapp.rc
      Target = Test
      Template = app
      
      #just the sources in my project Test.pro
      SOURCES += main.cpp\
                             file1.cpp\
                             file2.cpp
      
      #just the headers in my project Test.pro
      HEADERS+=file1.h\
                           file2.h
                           
      CONFIG += static
      
      FORMS +=mainwindow.ui
      RESOURCES+=resources.qrc
      
      #W is a mapped drive
      #W:/include is where my library headers "magic*.h" are
      INCLUDEPATH+= W:/include
      DEPENDPATH+=W:/include
      
      #W:/lib is where my libraries "magic*.lib" files are
      LIBS+=-L./W:/lib/ -lmagic1
      LIBS+=-L./W:/lib/ -lmagic2
      LIBS+=-L./W:/lib/ -lmagic3
      LIBS+=-L./W:/lib/ -lmagic4
      LIBS+=-L./W:/lib/ -lmagic5
      LIBS+=-L./W:/lib/ -lmagic6
      
      
      RandyHR Offline
      RandyHR Offline
      RandyH
      wrote on last edited by
      #2

      By the way, I configured using these options:

      configure -release -opensource -platform win32-msvc2013 -opengl desktop -static -nomake examples -nomake tests

      I only need release, I am not distributing this app so -opengl desktop is what I want. Please help if you can, thanks!

      1 Reply Last reply
      0
      • kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #3

        Hello @RandyH ,
        ./W:/lib/ isn't really a correct path, and the whole point of having separate paths passed to the linker is to save yourself some trouble of repeating them. The correct link line would look something like this:

        LIBS += -LW:/lib -lmagic1 -lmagic2 \
            -lmagic3 -lmagic4
        

        Hope that helps.
        Kind regards.

        Read and abide by the Qt Code of Conduct

        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