controller.cpp
#include "controller.h"
#include <QObject>
#include <QString>
#include <QVariant>
#include <QVariantList>
#include <QVariantMap>
#include <string>
#include <vector>
#include "controller.h"
#include "itemcontroller.h"
#include "modelcontroller.h"
#include "knowdesk/knowledgeDB.h"
#include "templatecontroller.h"
#include "filecontroller.h"
#include "libs/easylogging++.h"
void Controller::setQuery(QueryController* q) {
query = q;
}
QueryController* Controller::getQuery() {
return query;
}
.
.
.
#include "controller.h"
#include <QObject>
#include <QString>
#include <QVariant>
#include <QVariantList>
#include <QVariantMap>
#include <string>
#include <vector>
#include "controller.h"
#include "itemcontroller.h"
#include "modelcontroller.h"
#include "knowdesk/knowledgeDB.h"
#include "templatecontroller.h"
#include "filecontroller.h"
#include "libs/easylogging++.h"
void Controller::setQuery(QueryController* q) {
query = q;
}
QueryController* Controller::getQuery() {
return query;
}
.
.
.
To copy to clipboard, switch view to plain text mode
controller.h
#ifndef CONTROLLER_H
#define CONTROLLER_H
class QueryController;
class FileController;
class ModelController;
class TemplateController;
class ItemController;
class KnowledgeDB;
class Controller {
public:
void setQuery(QueryController*);
QueryController* getQuery();
void setFile(FileController*);
FileController* getFile();
void setModel(ModelController*);
ModelController* getModel();
void setTemplate(TemplateController*);
TemplateController* getTemplate();
void setItem(ItemController*);
ItemController* getItem();
void setDB(KnowledgeDB*);
KnowledgeDB* getDB();
private:
QueryController* query;
FileController* file;
ModelController* model;
TemplateController* template_;
ItemController* item;
KnowledgeDB* db;
};
#endif // CONTROLLER_H
#ifndef CONTROLLER_H
#define CONTROLLER_H
class QueryController;
class FileController;
class ModelController;
class TemplateController;
class ItemController;
class KnowledgeDB;
class Controller {
public:
void setQuery(QueryController*);
QueryController* getQuery();
void setFile(FileController*);
FileController* getFile();
void setModel(ModelController*);
ModelController* getModel();
void setTemplate(TemplateController*);
TemplateController* getTemplate();
void setItem(ItemController*);
ItemController* getItem();
void setDB(KnowledgeDB*);
KnowledgeDB* getDB();
private:
QueryController* query;
FileController* file;
ModelController* model;
TemplateController* template_;
ItemController* item;
KnowledgeDB* db;
};
#endif // CONTROLLER_H
To copy to clipboard, switch view to plain text mode
I don't actually use any of the Q* in controller.cpp. If I remove the #include <Q*> statements, this error will be thrown in the next Header File that attempts to include Q*, itemcontroller.h:
02:25:07: Running steps for project graphit...
02:25:07: Configuration unchanged, skipping qmake step.
02:25:07: Starting: "/usr/bin/make"
g++ -c -pipe -std=c++11 -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -std=c++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Iinclude -Iinclude/knowdesk -Ilibs -Ilibs -Ipodofo/include -Iexif/include -Iexif/include -isystem /usr/include/qt -isystem /usr/include/qt/QtQuick -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtQml -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtCore -Ibuild -I/usr/lib/qt/mkspecs/linux-g++ -o build/controller.o src/controller.cpp
In file included from /usr/include/qt/QtCore/qglobal.h:74:0,
from /usr/include/qt/QtCore/qnamespace.h:37,
from /usr/include/qt/QtCore/qobjectdefs.h:41,
from /usr/include/qt/QtCore/qobject.h:40,
from
/usr
/include
/qt
/QtCore
/QObject:1,
from include/itemcontroller.h:4,
from src/controller.cpp:6:
/usr/include/qt/QtCore/qurl.h:365:1: error: initializer provided for function
^
Makefile:975: recipe for target 'build/controller.o' failed
make: *** [build/controller.o] Error 1
02:25:09: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project graphit (kit: Desktop)
When executing step "Make"
02:25:09: Elapsed time: 00:03.
02:25:07: Running steps for project graphit...
02:25:07: Configuration unchanged, skipping qmake step.
02:25:07: Starting: "/usr/bin/make"
g++ -c -pipe -std=c++11 -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -std=c++0x -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Iinclude -Iinclude/knowdesk -Ilibs -Ilibs -Ipodofo/include -Iexif/include -Iexif/include -isystem /usr/include/qt -isystem /usr/include/qt/QtQuick -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtQml -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtCore -Ibuild -I/usr/lib/qt/mkspecs/linux-g++ -o build/controller.o src/controller.cpp
In file included from /usr/include/qt/QtCore/qglobal.h:74:0,
from /usr/include/qt/QtCore/qnamespace.h:37,
from /usr/include/qt/QtCore/qobjectdefs.h:41,
from /usr/include/qt/QtCore/qobject.h:40,
from /usr/include/qt/QtCore/QObject:1,
from include/itemcontroller.h:4,
from src/controller.cpp:6:
/usr/include/qt/QtCore/qurl.h:365:1: error: initializer provided for function
Q_DECLARE_SHARED(QUrl)
^
Makefile:975: recipe for target 'build/controller.o' failed
make: *** [build/controller.o] Error 1
02:25:09: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project graphit (kit: Desktop)
When executing step "Make"
02:25:09: Elapsed time: 00:03.
To copy to clipboard, switch view to plain text mode
I have gcc version 5.2.0 and the same error appears after I delete all build files, rerun qmake and rebuild.
I went back in my repo and found that the point where this compilation error first appears is when I change
QQmlEngine engine;
QApplication app(argc, argv);
QQmlEngine engine;
To copy to clipboard, switch view to plain text mode
to
QtQuickControlsApplication app(argc, argv);
QQmlApplicationEngine engine;
QtQuickControlsApplication app(argc, argv);
QQmlApplicationEngine engine;
To copy to clipboard, switch view to plain text mode
But even after changing this in back in the main.cpp file, or even commenting everything there out, it fails much at other files. So I'm not sure if this relates.
Bookmarks