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. Cannot link Qt libs to C++ project manually.

Cannot link Qt libs to C++ project manually.

Scheduled Pinned Locked Moved Unsolved General and Desktop
23 Posts 6 Posters 3.7k 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.
  • S Sirzhatina

    @SGaist It's really interesting, so let's make it clear.
    I build the next code

    boost::asio::io_context io;
    boost::asio::steady_timer t(io, boost::asio::chrono::seconds(5));
    
    std::cout << "Hey ";
    t.wait();
    std::cout << "lala ley ";
    

    And without next command
    /link /LIBPATH:C:\Program Files (x86)\Boost\boost_1_76_0\stage\lib
    I get linker error (no date-time library and so on - it's separately-compiled).
    And, of course, adding this command, I have the program built successfully. So, as you can see I have no need to link exact .lib file excplicitly.

    Christian EhrlicherC Online
    Christian EhrlicherC Online
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #21

    @Sirzhatina said in Cannot link Qt libs to C++ project manually.:

    So, as you can see I have no need to link exact .lib file excplicitly.

    We already explained why this works... but Qt does fortunately not support this.

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    S 1 Reply Last reply
    2
    • Christian EhrlicherC Christian Ehrlicher

      @Sirzhatina said in Cannot link Qt libs to C++ project manually.:

      So, as you can see I have no need to link exact .lib file excplicitly.

      We already explained why this works... but Qt does fortunately not support this.

      S Offline
      S Offline
      Sirzhatina
      wrote on last edited by Sirzhatina
      #22

      @Christian-Ehrlicher okay, thanks. But you said that's what msvc does. And I still use msvc to compile Qt libs, so what's the mystery here? I mean why does msvc auto-link one libraries and not auto-link others

      Christian EhrlicherC 1 Reply Last reply
      0
      • S Sirzhatina

        @Christian-Ehrlicher okay, thanks. But you said that's what msvc does. And I still use msvc to compile Qt libs, so what's the mystery here? I mean why does msvc auto-link one libraries and not auto-link others

        Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #23

        @Sirzhatina said in Cannot link Qt libs to C++ project manually.:

        I mean why does msvc auto-link one libraries and not auto-link others

        see the answer from @hskoglund - this is basically what the boost libs are doing and Qt not (because it's crappy, error-prone and non-portable)

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        2

        • Login

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