problem of integrating Qt files
Posted: Thu Jul 21, 2016 4:10 pm
I had these errors with my plugin generated by CMake
I tried also to import my Qt files without Cmake
(" mainwindow.h"; "mainwindow.cpp"; "ui_mainwindow.h"; "mainwindow.ui" and "moc_mainwindow.cpp"),
and this time, it worked.
I don't understand why since I had the same files
its strange that two "ui_mainwindow.h" are created.1>------ Début de la génération : Projet : QIRCLOUD_PLUGIN, Configuration : Release Win32 ------
1>QIRCLOUD_PLUGIN_automoc.obj : error LNK2005: "public: virtual struct QMetaObject const * __thiscall MainWindow::metaObject(void)const " (?metaObject@MainWindow@@UBEPBUQMetaObject@@XZ) déjà défini(e) dans moc_mainwindow.obj
1>QIRCLOUD_PLUGIN_automoc.obj : error LNK2005: "public: virtual int __thiscall MainWindow::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@MainWindow@@UAEHW4Call@QMetaObject@@HPAPAX@Z) déjà défini(e) dans moc_mainwindow.obj
1>QIRCLOUD_PLUGIN_automoc.obj : error LNK2005: "public: virtual void * __thiscall MainWindow::qt_metacast(char const *)" (?qt_metacast@MainWindow@@UAEPAXPBD@Z) déjà défini(e) dans moc_mainwindow.obj
1>QIRCLOUD_PLUGIN_automoc.obj : error LNK2005: "private: static void __cdecl MainWindow::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@MainWindow@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z) déjà défini(e) dans moc_mainwindow.obj
1>QIRCLOUD_PLUGIN_automoc.obj : error LNK2005: "public: static struct QMetaObject const MainWindow::staticMetaObject" (?staticMetaObject@MainWindow@@2UQMetaObject@@B) déjà défini(e) dans moc_mainwindow.obj
1> Création de la bibliothèque C:/ysong/CloudCompare/trunk-2.6.3.1/build/plugins/qIRCloud/Release/QIRCLOUD_PLUGIN.lib et de l'objet C:/ysong/CloudCompare/trunk-2.6.3.1/build/plugins/qIRCloud/Release/QIRCLOUD_PLUGIN.exp
1>C:\ysong\CloudCompare\trunk-2.6.3.1\build\plugins\qIRCloud\Release\QIRCLOUD_PLUGIN.dll : fatal error LNK1169: un ou plusieurs symboles définis à différentes reprises ont été rencontrés
========== Génération : 0 a réussi, 1 a échoué, 12 mis à jour, 0 a été ignoré ==========
I tried also to import my Qt files without Cmake
(" mainwindow.h"; "mainwindow.cpp"; "ui_mainwindow.h"; "mainwindow.ui" and "moc_mainwindow.cpp"),
and this time, it worked.
I don't understand why since I had the same files