[QScintilla] QScintilla + "new" Qt signal/slot syntax

Scott Bloom scott at towel42.com
Wed Apr 11 21:10:46 BST 2018


-----Original Message-----
From: QScintilla <qscintilla-bounces at riverbankcomputing.com> On Behalf Of Alan Garny
Sent: Wednesday, April 11, 2018 13:08
To: qscintilla at riverbankcomputing.com
Subject: Re: [QScintilla] QScintilla + "new" Qt signal/slot syntax

On 11/04/18, 11:54 PM, "Phil Thompson" <phil at riverbankcomputing.com> wrote:

    On 11 Apr 2018, at 12:34 pm, Alan Garny <agarny at hellix.com> wrote:
    > 
    > Hi,
    >  
    > I have modified my code to use Qt’s new signal/slot syntax, but I came across a problem when it comes to my QScintilla-based widget.
    >  
    > To get my code to work, I have to get a couple of QScintilla’s header files processed by Qt’s MOC (see here).
    
    Why? What happens if you don't?
    
Sorry, Phil, I should indeed have mentioned what happens if I don't. Basically, my build fails when trying to generate the DLL for my QScintilla-based widget:

[854/1032] Linking CXX shared library src\plugins\widget\EditorWidget\EditorWidget.dll
FAILED: src/plugins/widget/EditorWidget/EditorWidget.dll src/plugins/widget/EditorWidget/EditorWidget.lib
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir --manifests  -- C:\PROGRA~2\MICROS~3.0\VC\bin\amd64\link.exe /nologo src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\__\__\i18ninterface.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\__\__\plugininfo.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\editorlistwidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\editorwidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\editorwidgetfindreplacewidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\editorwidgetplugin.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\moc_editorlistwidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\moc_editorwidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\moc_editorwidgetfindreplacewidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\moc_editorwidgetplugin.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\qrc_EditorWidget_i18n.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\qrc_EditorWidget_ui.cpp.obj  /out:src\plugins\widget\EditorWidget\EditorWidget.dll /implib:src\plugins\widget\EditorWidget\EditorWidget.lib /pdb:src\plugins\widget\EditorWidget\EditorWidget.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /STACK:10000000  src\plugins\support\QScintillaSupport\QScintillaSupport.lib src\plugins\miscellaneous\Core\Core.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5Widgets.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5Gui.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5Xml.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5XmlPatterns.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5Network.lib src\plugins\thirdParty\QScintilla\QScintilla.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5Core.lib ..\src\plugins\thirdParty\QScintilla\ext\release\lib\qscintilla2_qt5.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cmd.exe /C "cd /D C:\Users\Alan\Desktop\OpenCOR\build\src\plugins\widget\EditorWidget && "C:\Program Files\CMake\bin\cmake.exe" -E copy C:/Users/Alan/Desktop/OpenCOR/build/src/plugins/widget/EditorWidget/EditorWidget.dll C:/Users/Alan/Desktop/OpenCOR/build/plugins/OpenCOR/EditorWidget.dll""
LINK: command "C:\PROGRA~2\MICROS~3.0\VC\bin\amd64\link.exe /nologo src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\__\__\i18ninterface.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\__\__\plugininfo.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\editorlistwidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\editorwidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\editorwidgetfindreplacewidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\editorwidgetplugin.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\moc_editorlistwidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\moc_editorwidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\moc_editorwidgetfindreplacewidget.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\src\moc_editorwidgetplugin.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\qrc_EditorWidget_i18n.cpp.obj src\plugins\widget\EditorWidget\CMakeFiles\EditorWidgetPlugin.dir\qrc_EditorWidget_ui.cpp.obj /out:src\plugins\widget\EditorWidget\EditorWidget.dll /implib:src\plugins\widget\EditorWidget\EditorWidget.lib /pdb:src\plugins\widget\EditorWidget\EditorWidget.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO /STACK:10000000 src\plugins\support\QScintillaSupport\QScintillaSupport.lib src\plugins\miscellaneous\Core\Core.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5Widgets.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5Gui.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5Xml.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5XmlPatterns.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5Network.lib src\plugins\thirdParty\QScintilla\QScintilla.lib C:\Qt\5.9.4\msvc2015_64\lib\Qt5Core.lib ..\src\plugins\thirdParty\QScintilla\ext\release\lib\qscintilla2_qt5.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:src\plugins\widget\EditorWidget\EditorWidget.dll.manifest" failed (exit code 1120) with the following output:
   Creating library src\plugins\widget\EditorWidget\EditorWidget.lib and object src\plugins\widget\EditorWidget\EditorWidget.exp
editorwidget.cpp.obj : error LNK2019: unresolved external symbol "public: static struct QMetaObject const QsciScintillaBase::staticMetaObject" (?staticMetaObject at QsciScintillaBase@@2UQMetaObject@@B) referenced in function "public: static class QMetaObject::Connection __cdecl QObject::connect<void (__cdecl QsciScintillaBase::*)(void),void (__cdecl OpenCOR::EditorWidget::EditorWidget::*)(void)>(class QsciScintillaBase const *,void (__cdecl QsciScintillaBase::*)(void),class OpenCOR::EditorWidget::EditorWidget const *,void (__cdecl OpenCOR::EditorWidget::EditorWidget::*)(void),enum Qt::ConnectionType)" (??$connect at P8QsciScintillaBase@@EAAXXZP8EditorWidget at 2OpenCOR@@EAAXXZ at QObject@@SA?AVConnection at QMetaObject@@PEBVQsciScintillaBase@@P83 at EAAXXZPEBVEditorWidget@4OpenCOR@@P8445 at EAAXXZW4ConnectionType@Qt@@@Z)
editorwidget.cpp.obj : error LNK2019: unresolved external symbol "public: static struct QMetaObject const QsciScintilla::staticMetaObject" (?staticMetaObject at QsciScintilla@@2UQMetaObject@@B) referenced in function "public: static class QMetaObject::Connection __cdecl QObject::connect<void (__cdecl QsciScintilla::*)(int,int),void (__cdecl OpenCOR::EditorWidget::EditorWidget::*)(int,int)>(class QsciScintilla const *,void (__cdecl QsciScintilla::*)(int,int),class OpenCOR::EditorWidget::EditorWidget const *,void (__cdecl OpenCOR::EditorWidget::EditorWidget::*)(int,int),enum Qt::ConnectionType)" (??$connect at P8QsciScintilla@@EAAXHH at ZP8EditorWidget@2OpenCOR@@EAAXHH at Z@QObject@@SA?AVConnection at QMetaObject@@PEBVQsciScintilla@@P83 at EAAXHH@ZPEBVEditorWidget at 4OpenCOR@@P8445 at EAAXHH@ZW4ConnectionType at Qt@@@Z)
src\plugins\widget\EditorWidget\EditorWidget.dll : fatal error LNK1120: 2 unresolved externals [857/1032] Generating src/moc_simulationexperimentviewwidget.cpp
ninja: build stopped: subcommand failed.

Cheers, Alan. 


_______________________________________________
QScintilla mailing list
QScintilla at riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/qscintilla
---------------------
All of the QObject based QScintilla headers have to be run through moc.  These warnings are typical of a QObject based class not being moc'ed


More information about the QScintilla mailing list