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. Qt library link errors under Windows
Qt 6.11 is out! See what's new in the release blog

Qt library link errors under Windows

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 679 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.
  • Aleksey_K 0A Offline
    Aleksey_K 0A Offline
    Aleksey_K 0
    wrote on last edited by Aleksey_K 0
    #1

    Project builds just fine in Linux, however fails to link under Windows.

    1st issue (solved)

    Solved here: https://stackoverflow.com/q/50064670/630169


    2nd issue:

    In the library .pro file VERSION variable is defined and resulting library has name MyLibrary1.lib. Thereafter I get error:

    :-1: error: LNK1181: cannot open input file 'MyLibrary.lib'
    

    What is better way to solve the problem here: remove VERSION or fix .pro file? How?


    3rd issue:

    Another link error:

    mydialog.obj:-1: error: LNK2001: unresolved external symbol 
    "struct QMetaObject const MyLibrary::staticMetaObject" 
    (?staticMetaObject@MyLibrary@@3UQMetaObject@@B)
    

    Error happen because of the following line in code (disappears when commented out):

    mydialog.cpp:

        QMetaEnum myEnum = QMetaEnum::fromType<MyLibrary::MyEnumClass>();
    

    mylibrary.h:

    namespace MyLibrary {
    
    Q_NAMESPACE
    
    enum class MYLIBRARYSHARED_EXPORT MyEnumClass {
    ...
    };
    
    Q_ENUM_NS(MyEnumClass)
    ...
    } // namespace MyLibrary
    

    And how to solve the 3rd one?

    1 Reply Last reply
    0
    • Aleksey_K 0A Offline
      Aleksey_K 0A Offline
      Aleksey_K 0
      wrote on last edited by
      #2

      Solution is here: https://stackoverflow.com/a/50064976/630169

      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