[Development] Qt library link errors under Windows
Aleksey Kontsevich
tantrido at ya.ru
Fri Apr 27 19:11:52 CEST 2018
Project builds just fine in Linux, however fails to link under Windows. Building with Qt 5.10.1 and MSVC 2015.
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 at 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.cpp:
namespace MyLibrary {
Q_NAMESPACE
enum class MYLIBRARYSHARED_EXPORT MyEnumClass {
...
};
Q_ENUM_NS(MyEnumClass)
...
} // namespace MyLibrary
And how to solve the 3rd one? What is it: Qt or Windows (MSVC) bug? Code or link flags problem?
Thanks!
--
Best regards,
Aleksey
Linked in https://www.linkedin.com/in/alekseykontsevich
More information about the Development
mailing list