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. Possible to link without qmake or other tools? [Edited] [Mostly Solved]

Possible to link without qmake or other tools? [Edited] [Mostly Solved]

Scheduled Pinned Locked Moved General and Desktop
vs2013dynamic linkinglinker errors
2 Posts 2 Posters 1.2k 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.
  • J Offline
    J Offline
    Joshua T. Fisher
    wrote on 21 Jun 2015, 10:39 last edited by Joshua T. Fisher
    #1

    Hey there folks. I'm attempting to create a project in Visual Studio 2013 that can dynamically link to Qt. I'm using CMake to generate my project, but for various reasons it's not ideal for me to have an installed copy of Qt to depend on. So in my repository I have all the Dlls from the installed copy in a path like this: "Dependencies/Qt/library/x64", with all of the folders in the installed copies include directory in a path like this: "/Dependencies/Qt/include"

    I'm attempting to compile an executable with the following code as a test:

    #include "QtWidgets/QApplication.h"
    #include "QtWidgets/QLabel.h"
    
    int main(int argc, char *argv[])
    {
      QApplication app(argc, argv);
      QLabel *label = new QLabel("Hello Qt!");
      label->show();
      return app.exec();
    }
    

    But unfortunately I get linker errors which are at the bottom of this post.

    Now I can't say this was unexpected, but I would like to know how to dynamically link to Qt correctly without relying on its tools to generate my sln or find the library for CMake, if that's at all possible.

    Thanks for reading!

    [Begin Edit]
    I've solved my problem. I wasn't attempting to link with the installed library files. Just to be clear, this is still considered Dynamic linking is it not? So I'd still fall into the Dynamic Linking exception of the LGPL 2.1 correct?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 21 Jun 2015, 21:32 last edited by
      #2

      Hi and welcome to devnet,

      CMake has a Qt 5 finder script that you can use, you would only need to add the path where to find Qt 5 when you call cmake and it will handle things for you.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      2/2

      21 Jun 2015, 21:32

      • Login

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