Discussion:
Linking problem with ScintillaEdit for Qt on Windows
(too old to reply)
Steve Lamperti
2014-07-08 18:06:17 UTC
Permalink
I'm trying to build scintilla for a Qt based project on windows. I think I'm building the DLL OK, but when I try to link in my visual studio 2013 project, I get the following link error:


1>EIncludeWidget.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const ScintillaEdit::staticMetaObject" (?***@ScintillaEdit@@2UQMetaObject@@B)


I suspect that what is happening is that the linker is not recognizing the ScintillaEdit as a QObject descended object, but I am not at all sure what to do to fix this. (The EIncludeWidget is my own object that descends from ScintillaEdit.)

If anyone has any suggestions for me, I would really appreciate it.
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
Steve Lamperti
2014-07-08 23:21:01 UTC
Permalink
I've made some progress. I got around my original problem by including the
moc_ScintillaEdit.cpp, moc_ScintillaQt.cpp, moc_ScintillaEditBase.cpp and
moc_scintillaDocument.cpp files in my project.
This got rid of the link error on the staticMetaObject. Now, however, I
have four link errors on four slots defined in ScintillaQt:

1>moc_ScintillaQt.obj : error LNK2019: unresolved external symbol "private:
void __thiscall ScintillaQt::tick(void)" (?***@ScintillaQt@@AAEXXZ)
referenced in function "private: static void __cdecl
ScintillaQt::qt_static_metacall(class QObject *,enum
QMetaObject::Call,int,void * *)"
(?***@ScintillaQt@@CAXPAVQObject@@***@QMetaObject@@***@Z)
1>moc_ScintillaQt.obj : error LNK2019: unresolved external symbol "private:
void __thiscall ScintillaQt::onIdle(void)" (?***@ScintillaQt@@AAEXXZ)
referenced in function "private: static void __cdecl
ScintillaQt::qt_static_metacall(class QObject *,enum
QMetaObject::Call,int,void * *)"
(?***@ScintillaQt@@CAXPAVQObject@@***@QMetaObject@@***@Z)
1>moc_ScintillaQt.obj : error LNK2019: unresolved external symbol "private:
void __thiscall ScintillaQt::execCommand(class QAction *)"
(?***@ScintillaQt@@AAEXPAVQAction@@@Z) referenced in function
"private: static void __cdecl ScintillaQt::qt_static_metacall(class QObject
*,enum QMetaObject::Call,int,void * *)"
(?***@ScintillaQt@@CAXPAVQObject@@***@QMetaObject@@***@Z)
1>moc_ScintillaQt.obj : error LNK2019: unresolved external symbol "private:
void __thiscall ScintillaQt::SelectionChanged(void)"
(?***@ScintillaQt@@AAEXXZ) referenced in function "private:
static void __cdecl ScintillaQt::qt_static_metacall(class QObject *,enum
QMetaObject::Call,int,void * *)"
(?***@ScintillaQt@@CAXPAVQObject@@***@QMetaObject@@***@Z)

These are the only link errors, and I think therefore that I might be
close, but I am still not sure what I am doing wrong.

These four methods are the four private slots in scintillaQt.h, and none of
the other methods are coming up as link errors, so it must have something
to do with my issue.

If someone has any idea how to resolve these link errors, or could
enlighten me as to if I am doing something fundamentally wrong, I would
appreciate any help,

Thanks,
Post by Steve Lamperti
I'm trying to build scintilla for a Qt based project on windows. I think
I'm building the DLL OK, but when I try to link in my visual studio 2013
static struct QMetaObject const ScintillaEdit::staticMetaObject"
I suspect that what is happening is that the linker is not recognizing the
ScintillaEdit as a QObject descended object, but I am not at all sure what
to do to fix this. (The EIncludeWidget is my own object that descends from
ScintillaEdit.)
If anyone has any suggestions for me, I would really appreciate it.
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
Neil Hodgson
2014-07-08 23:43:34 UTC
Permalink
I've made some progress. I got around my original problem by including the moc_ScintillaEdit.cpp, moc_ScintillaQt.cpp, moc_ScintillaEditBase.cpp and moc_scintillaDocument.cpp files in my project.
It may be easier to work with Qt Creator or qmake rather than directly with Visual C++ since those applications know more about the way executables are built with Qt. You may need to copy some of the build outputs (ScintillaEditBase3.lib, for example) to be included in your build.

There is a small demonstration application that links in ScintillaEditBase here:
http://scintilla.org/haven.zip

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
Steve Lamperti
2014-07-09 00:28:42 UTC
Permalink
I probably should have included some more background information about my
question. It's hard to know how much to add without adding too much.
I'm trying to add scintilla to a very large visual studio 2013 project that
is a app that has a code editing window in it. I've already built
scintilla from the qt/scintillaEdit folder using qMake and nmake. I've put
the resulting DLL and library files into my Qt folder in the appropriate
places, I believe. The link errors I am getting are when I try to build my
larger project, and it tries to link.

I had already had some success with building our project with QScintilla,
but after working with that for a while, I saw that scintilla had it's own
Qt interface with the scintillaEdit/scintillaEditBase stuff, and I thought
that I would try using that instead, as it seemed more direct, and I also
didn't know of anything obvious that QScintilla would add over the base
stuff.

I hope this clarifies my question, and hope that I am not imposing by
asking it here.

Thanks
Post by Steve Lamperti
I've made some progress. I got around my original problem by including
the moc_ScintillaEdit.cpp, moc_ScintillaQt.cpp, moc_ScintillaEditBase.cpp
and moc_scintillaDocument.cpp files in my project.
It may be easier to work with Qt Creator or qmake rather than directly
with Visual C++ since those applications know more about the way
executables are built with Qt. You may need to copy some of the build
outputs (ScintillaEditBase3.lib, for example) to be included in your build.
There is a small demonstration application that links in
http://scintilla.org/haven.zip
Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
Loading...