Building on Windows
matkuki opened this issue · 8 comments
Hi,
Specs:
- Windows 10 x64
- Nim 1.6.10 x64
- Qt 6.3.1 for MSVC2019
Managed to get it to compile, but linking is now a problem.
The compilation command is: nim cpp --cc:vcc --passC:"-permissive- -Zc:__cplusplus /std:c++17 /Zc:strictStrings-" --passL:"/link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /OPT:ICF /INCREMENTAL:NO /SUBSYSTEM:WINDOWS MANIFEST:embed" qttest.nim
This is the compilation output:
J:\Nim\nimqt\test>nim build.nims
Hint: used config file 'C:\Users\matic\.choosenim\toolchains\nim-1.6.10\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\matic\.choosenim\toolchains\nim-1.6.10\config\config.nims' [Conf]
[NimScript] exec: nim cpp --cc:vcc --passC:"-permissive- -Zc:__cplusplus /std:c++17 /Zc:strictStrings-" --passL:"/link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /OPT:ICF /INCREMENTAL:NO /SUBSYSTEM:WINDOWS" qttest.nim
Hint: used config file 'C:\Users\matic\.choosenim\toolchains\nim-1.6.10\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\matic\.choosenim\toolchains\nim-1.6.10\config\config.nims' [Conf]
Hint: used config file 'J:\Nim\nimqt\test\qttest.nim.cfg' [Conf]
.....................................................................................................................................................
Hint: [Link]
cl : Command line warning D9002 : ignoring unknown option '-lQt6Core'
cl : Command line warning D9002 : ignoring unknown option '-lQt6Gui'
cl : Command line warning D9002 : ignoring unknown option '-lQt6Widgets'
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtcore@sqstring.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QString::QString(void)" (__imp_??0QString@@QEAA@XZ) referenced in function "class QString __cdecl Q__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtcoreZqstring_655(struct NimStringDesc *)" (?Q__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtcoreZqstring_655@@YA?AVQString@@PEAUNimStringDesc@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtcore@sqstring.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QString::~QString(void)" (__imp_??1QString@@QEAA@XZ) referenced in function "class QString __cdecl Q__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtcoreZqstring_655(struct NimStringDesc *)" (?Q__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtcoreZqstring_655@@YA?AVQString@@PEAUNimStringDesc@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl QString::~QString(void)" (__imp_??1QString@@QEAA@XZ)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtcore@sqstring.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QString::QString(class QString &&)" (__imp_??0QString@@QEAA@$$QEAV0@@Z) referenced in function "class QString __cdecl Q__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtcoreZqstring_655(struct NimStringDesc *)" (?Q__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtcoreZqstring_655@@YA?AVQString@@PEAUNimStringDesc@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtcore@sqstring.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString & __cdecl QString::operator=(class QString &&)" (__imp_??4QString@@QEAAAEAV0@$$QEAV0@@Z) referenced in function "class QString __cdecl Q__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtcoreZqstring_655(struct NimStringDesc *)" (?Q__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtcoreZqstring_655@@YA?AVQString@@PEAUNimStringDesc@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtcore@sqstring.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QString::QString(char const *)" (__imp_??0QString@@QEAA@PEBD@Z) referenced in function "class QString __cdecl Q__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtcoreZqstring_655(struct NimStringDesc *)" (?Q__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtcoreZqstring_655@@YA?AVQString@@PEAUNimStringDesc@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QApplication::QApplication(int &,char * *,int)" (__imp_??0QApplication@@QEAA@AEAHPEAPEADH@Z) referenced in function "class QApplication * __cdecl newQApplication__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtwidgetsZqapplication_107(struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ *)" (?newQApplication__6758Z85sersZmaticZOnimbleZpkgsZnimqt4548O49ZnimqtZqtwidgetsZqapplication_107@@YAPEAVQApplication@@PEAUtySequence__sM4lkSb7zS6F7OVMvW9cffQ@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QApplication::~QApplication(void)" (__imp_??1QApplication@@UEAA@XZ) referenced in function "public: virtual void * __cdecl QApplication::`scalar deleting destructor'(unsigned int)" (??_GQApplication@@UEAAPEAXI@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl QApplication::metaObject(void)const " (?metaObject@QApplication@@UEBAPEBUQMetaObject@@XZ)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl QApplication::qt_metacast(char const *)" (?qt_metacast@QApplication@@UEAAPEAXPEBD@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl QApplication::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@QApplication@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl QApplication::notify(class QObject *,class QEvent *)" (?notify@QApplication@@UEAA_NPEAVQObject@@PEAVQEvent@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl QApplication::event(class QEvent *)" (?event@QApplication@@MEAA_NPEAVQEvent@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl QApplication::compressEvent(class QEvent *,class QObject *,class QPostEventList *)" (?compressEvent@QApplication@@MEAA_NPEAVQEvent@@PEAVQObject@@PEAVQPostEventList@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl QObject::eventFilter(class QObject *,class QEvent *)" (?eventFilter@QObject@@UEAA_NPEAV1@PEAVQEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl QObject::eventFilter(class QObject *,class QEvent *)" (?eventFilter@QObject@@UEAA_NPEAV1@PEAVQEvent@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::timerEvent(class QTimerEvent *)" (?timerEvent@QObject@@MEAAXPEAVQTimerEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::timerEvent(class QTimerEvent *)" (?timerEvent@QObject@@MEAAXPEAVQTimerEvent@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::childEvent(class QChildEvent *)" (?childEvent@QObject@@MEAAXPEAVQChildEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::childEvent(class QChildEvent *)" (?childEvent@QObject@@MEAAXPEAVQChildEvent@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::customEvent(class QEvent *)" (?customEvent@QObject@@MEAAXPEAVQEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::customEvent(class QEvent *)" (?customEvent@QObject@@MEAAXPEAVQEvent@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::connectNotify(class QMetaMethod const &)" (?connectNotify@QObject@@MEAAXAEBVQMetaMethod@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::connectNotify(class QMetaMethod const &)" (?connectNotify@QObject@@MEAAXAEBVQMetaMethod@@@Z)
@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::disconnectNotify(class QMetaMethod const &)" (?disconnectNotify@QObject@@MEAAXAEBVQMetaMethod@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QObject::disconnectNotify(class QMetaMethod const &)" (?disconnectNotify@QObject@@MEAAXAEBVQMetaMethod@@@Z)
@mqttest.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl QWidget::show(void)" (__imp_?show@QWidget@@QEAAXXZ) referenced in function "void __cdecl NimMainModule(void)" (?NimMainModule@@YAXXZ)
@mqttest.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QLabel::QLabel(class QString const &,class QWidget *,class QFlags<enum Qt::WindowType>)" (__imp_??0QLabel@@QEAA@AEBVQString@@PEAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) referenced in function "void __cdecl NimMainModule(void)" (?NimMainModule@@YAXXZ)
@mqttest.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QLabel::~QLabel(void)" (__imp_??1QLabel@@UEAA@XZ) referenced in function "public: virtual void * __cdecl QLabel::`scalar deleting destructor'(unsigned int)" (??_GQLabel@@UEAAPEAXI@Z)
@mqttest.nim.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl QApplication::exec(void)" (__imp_?exec@QApplication@@SAHXZ) referenced in function "void __cdecl NimMainModule(void)" (?NimMainModule@@YAXXZ)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl QLabel::metaObject(void)const " (?metaObject@QLabel@@UEBAPEBUQMetaObject@@XZ)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl QLabel::qt_metacast(char const *)" (?qt_metacast@QLabel@@UEAAPEAXPEBD@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl QLabel::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@QLabel@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class QSize __cdecl QLabel::sizeHint(void)const " (?sizeHint@QLabel@@UEBA?AVQSize@@XZ)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class QSize __cdecl QLabel::minimumSizeHint(void)const " (?minimumSizeHint@QLabel@@UEBA?AVQSize@@XZ)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl QLabel::heightForWidth(int)const " (?heightForWidth@QLabel@@UEBAHH@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl QLabel::event(class QEvent *)" (?event@QLabel@@MEAA_NPEAVQEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::keyPressEvent(class QKeyEvent *)" (?keyPressEvent@QLabel@@MEAAXPEAVQKeyEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::paintEvent(class QPaintEvent *)" (?paintEvent@QLabel@@MEAAXPEAVQPaintEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::changeEvent(class QEvent *)" (?changeEvent@QLabel@@MEAAXPEAVQEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::mousePressEvent(class QMouseEvent *)" (?mousePressEvent@QLabel@@MEAAXPEAVQMouseEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::mouseMoveEvent(class QMouseEvent *)" (?mouseMoveEvent@QLabel@@MEAAXPEAVQMouseEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::mouseReleaseEvent(class QMouseEvent *)" (?mouseReleaseEvent@QLabel@@MEAAXPEAVQMouseEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::contextMenuEvent(class QContextMenuEvent *)" (?contextMenuEvent@QLabel@@MEAAXPEAVQContextMenuEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::focusInEvent(class QFocusEvent *)" (?focusInEvent@QLabel@@MEAAXPEAVQFocusEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QLabel::focusOutEvent(class QFocusEvent *)" (?focusOutEvent@QLabel@@MEAAXPEAVQFocusEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl QLabel::focusNextPrevChild(bool)" (?focusNextPrevChild@QLabel@@MEAA_N_N@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl QWidget::devType(void)const " (?devType@QWidget@@UEBAHXZ)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl QWidget::setVisible(bool)" (?setVisible@QWidget@@UEAAX_N@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl QWidget::hasHeightForWidth(void)const " (?hasHeightForWidth@QWidget@@UEBA_NXZ)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class QPaintEngine * __cdecl QWidget::paintEngine(void)const " (?paintEngine@QWidget@@UEBAPEAVQPaintEngine@@XZ)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::mouseDoubleClickEvent(class QMouseEvent *)" (?mouseDoubleClickEvent@QWidget@@MEAAXPEAVQMouseEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::wheelEvent(class QWheelEvent *)" (?wheelEvent@QWidget@@MEAAXPEAVQWheelEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::keyReleaseEvent(class QKeyEvent *)" (?keyReleaseEvent@QWidget@@MEAAXPEAVQKeyEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::enterEvent(class QEnterEvent *)" (?enterEvent@QWidget@@MEAAXPEAVQEnterEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::leaveEvent(class QEvent *)" (?leaveEvent@QWidget@@MEAAXPEAVQEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::moveEvent(class QMoveEvent *)" (?moveEvent@QWidget@@MEAAXPEAVQMoveEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::resizeEvent(class QResizeEvent *)" (?resizeEvent@QWidget@@MEAAXPEAVQResizeEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::closeEvent(class QCloseEvent *)" (?closeEvent@QWidget@@MEAAXPEAVQCloseEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::tabletEvent(class QTabletEvent *)" (?tabletEvent@QWidget@@MEAAXPEAVQTabletEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::actionEvent(class QActionEvent *)" (?actionEvent@QWidget@@MEAAXPEAVQActionEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::dragEnterEvent(class QDragEnterEvent *)" (?dragEnterEvent@QWidget@@MEAAXPEAVQDragEnterEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::dragMoveEvent(class QDragMoveEvent *)" (?dragMoveEvent@QWidget@@MEAAXPEAVQDragMoveEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::dragLeaveEvent(class QDragLeaveEvent *)" (?dragLeaveEvent@QWidget@@MEAAXPEAVQDragLeaveEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::dropEvent(class QDropEvent *)" (?dropEvent@QWidget@@MEAAXPEAVQDropEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::showEvent(class QShowEvent *)" (?showEvent@QWidget@@MEAAXPEAVQShowEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::hideEvent(class QHideEvent *)" (?hideEvent@QWidget@@MEAAXPEAVQHideEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl QWidget::nativeEvent(class QByteArray const &,void *,__int64 *)" (?nativeEvent@QWidget@@MEAA_NAEBVQByteArray@@PEAXPEA_J@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl QWidget::metric(enum QPaintDevice::PaintDeviceMetric)const " (?metric@QWidget@@MEBAHW4PaintDeviceMetric@QPaintDevice@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::initPainter(class QPainter *)const " (?initPainter@QWidget@@MEBAXPEAVQPainter@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class QPaintDevice * __cdecl QWidget::redirected(class QPoint *)const " (?redirected@QWidget@@MEBAPEAVQPaintDevice@@PEAVQPoint@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual class QPainter * __cdecl QWidget::sharedPainter(void)const " (?sharedPainter@QWidget@@MEBAPEAVQPainter@@XZ)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QWidget::inputMethodEvent(class QInputMethodEvent *)" (?inputMethodEvent@QWidget@@MEAAXPEAVQInputMethodEvent@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class QVariant __cdecl QWidget::inputMethodQuery(enum Qt::InputMethodQuery)const " (?inputMethodQuery@QWidget@@UEBA?AVQVariant@@W4InputMethodQuery@Qt@@@Z)
@mqttest.nim.cpp.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QFrame::initStyleOption(class QStyleOptionFrame *)const " (?initStyleOption@QFrame@@MEBAXPEAVQStyleOptionFrame@@@Z)
LIBCMT.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
J:\Nim\nimqt\test\qttest.exe : fatal error LNK1120: 69 unresolved externals
Error: execution of an external program failed: 'vccexe.exe --platform:amd64 /FeJ:\Nim\nimqt\test\qttest.exe C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.choosenim@stoolchains@snim-1.6.10@slib@sstd@sprivate@sdigitsutils.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.choosenim@stoolchains@snim-1.6.10@slib@ssystem@sdollars.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.choosenim@stoolchains@snim-1.6.10@slib@ssystem@sio.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.choosenim@stoolchains@snim-1.6.10@slib@ssystem.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.choosenim@stoolchains@snim-1.6.10@slib@spure@sdynlib.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.choosenim@stoolchains@snim-1.6.10@slib@swindows@swinlean.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.choosenim@stoolchains@snim-1.6.10@slib@spure@stimes.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.choosenim@stoolchains@snim-1.6.10@slib@sstd@sprivate@swin_setenv.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.choosenim@stoolchains@snim-1.6.10@slib@spure@sos.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtcore@sqstring.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mC@c@sUsers@smatic@s.nimble@spkgs@snimqt-0.1@snimqt@sqtwidgets@sqapplication.nim.cpp.obj C:\Users\matic\nimcache\qttest_d\@mqttest.nim.cpp.obj /nologo -lQt6Core -lQt6Gui -lQt6Widgets /link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /OPT:ICF /INCREMENTAL:NO /SUBSYSTEM:WINDOWS '
stack trace: (most recent call last)
J:\Nim\nimqt\test\build.nims(7, 10)
C:\Users\matic\.choosenim\toolchains\nim-1.6.10\lib\system\nimscript.nim(273, 7) exec
C:\Users\matic\.choosenim\toolchains\nim-1.6.10\lib\system\nimscript.nim(273, 7) Error: unhandled exception: FAILED: nim cpp --cc:vcc --passC:"-permissive- -Zc:__cplusplus /std:c++17 /Zc:strictStrings-" --passL:"/link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /OPT:ICF /INCREMENTAL:NO /SUBSYSTEM:WINDOWS" qttest.nim [OSError]
This is the updated compilation command:
nim cpp --cc:vcc --outdir:build --passC:" -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -O2 -MD -std:c++17 -utf-8 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DNDEBUG -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -IC:\Nim\lib -I..\..\Qt6\6.3.1\msvc2019_64\include -I..\..\Qt6\6.3.1\msvc2019_64\include\QtWidgets -I..\..\Qt6\6.3.1\msvc2019_64\include\QtGui -I..\..\Qt6\6.3.1\msvc2019_64\include\QtCore -I/include -I..\..\Qt6\6.3.1\msvc2019_64\mkspecs\win32-msvc /Zc:strictStrings- shell32.lib" --passL:"/link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /OPT:ICF /INCREMENTAL:NO /SUBSYSTEM:WINDOWS shell32.lib" --clib:J:\Qt6\6.3.1\msvc2019_64\lib\Qt6Widgets --clib:J:\Qt6\6.3.1\msvc2019_64\lib\Qt6Gui --clib:J:\Qt6\6.3.1\msvc2019_64\lib\Qt6Core --clib:J:\Qt6\6.3.1\msvc2019_64\lib\Qt6EntryPoint qttest.nim
On to the next step of getting it to run on Windows :)
cl : Command line warning D9002 : ignoring unknown option '-lQt6Core'
cl : Command line warning D9002 : ignoring unknown option '-lQt6Gui'
cl : Command line warning D9002 : ignoring unknown option '-lQt6Widgets'
So, I guess -l
is not a valid flag (and possibly some other parameters are missing, once that is fixed).
I barely use Windows. Could you figure out what flags should be used, by compiling a toy c++ Qt program and looking at the flags?
Whoa, simultaneous posting 😊
Got it working, see my above comment, thanks.
Thanks!
That looks like an impressive compilation command. Do you know the minimal set of flags that are necessary to get it working?
@jerous86
Here are the minimized options for compilation on Windows, I'll write it as a list:
- nim
- cpp
- --cc:vcc
- --passC:"-permissive- -Zc:__cplusplus -std:c++17 -IJ:\Qt6\6.3.1\msvc2019_64\include -IJ:\Qt6\6.3.1\msvc2019_64\include\QtWidgets -IJ:\Qt6\6.3.1\msvc2019_64\include\QtGui -IJ:\Qt6\6.3.1\msvc2019_64\include\QtCore -IJ:\Qt6\6.3.1\msvc2019_64\mkspecs\win32-msvc /Zc:strictStrings- shell32.lib"
- --passL:"/link /SUBSYSTEM:WINDOWS shell32.lib"
- --clib:J:\Qt6\6.3.1\msvc2019_64\lib\Qt6Widgets
- --clib:J:\Qt6\6.3.1\msvc2019_64\lib\Qt6Gui
- --clib:J:\Qt6\6.3.1\msvc2019_64\lib\Qt6Core
- --clib:J:\Qt6\6.3.1\msvc2019_64\lib\Qt6EntryPoint
- test_nimqt_app.nim
Hope it helps
Thank you @matkuki!
Do you have any idea how I can add these --clib
flags transparently for the user? I don't think there's a pragma for this, and not sure how to selectively add them to nimble configuration, by getting output from qmake
.
Do you have any idea how I can add these --clib flags transparently for the user?
No idea, sorry.
I personally don't like things like this to be added implicitly under-the-hood
, I prefer that it would just be a note in the readme
to manually add these flags.