[continued; I exceeded the character limit]
I am completely at a loss as to why I get the 8 above errors with both parts uncommented to start with, and get a completely different error after some jiggery-pokery with commenting and un-commenting; I am confident that I followed exactly the same process as I did before when I successfully built the project statically. Online searches suggested that re-defining #defines used in header files could cause such errors, but, having skimmed qglobal.h, I am confident I haven't re-used any variable names.
I would be extremely appreciative of any help to solve this problem; I'm stumped.
Thank you in advance.
main.cpp
@#include <QtPlugin>
Q_IMPORT_PLUGIN(qsqlite)
Q_IMPORT_PLUGIN(qsvg)
Q_IMPORT_PLUGIN(qtaccessiblewidgets)
#include <QApplication>
#include "homewindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
HomeWindow *window = new HomeWindow();
window->show();
return app.exec();
}
@
.pro
@OTHER_FILES +=
...
HEADERS +=
...
SOURCES +=
...
FORMS +=
...
QT +=
sql
network
svg
script
CONFIG += static
static {
CONFIG += static
QTPLUGIN += qsqlite qsvg qtaccessiblewidgets
DEFINES += static
message("Static build.")
}
win32 {
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
}@
studywindow.h
@#ifndef STUDYWINDOW_H
#define STUDYWINDOW_H
#include <QMainWindow>
#include "dbfieldenums.h"
#include <QSqlRelationalTableModel>
#include <QSqlRecord>
#include <QTime>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QSvgWidget>
namespace Ui {
class StudyWindow;
}
class StudyWindow : public QMainWindow
{
Q_OBJECT
public:
explicit StudyWindow(QSqlRelationalTableModel *newItems, QSqlRelationalTableModel *reviewItems, QSqlRelationalTableModel *pNativeGenders, QSqlRelationalTableModel *pTargetGenders, quint16 userReactionInterval, quint16 userCharacterInterval, English pEnglish,
QWidget *pCaller = 0, QWidget *parent = 0);
~StudyWindow();
protected:
...
private:
...
private slots:
...
signals:
...
};
#endif // STUDYWINDOW_H
@
EDIT:
I've since been able to fix my problem, which was actually two:
The compiler errors were because my .pro file contained the line "DEFINES += static", which should have been "DEFINES += STATIC".
The linker error was because my configure command (-qt-sql-sqlite) had built the qsqlite library into Qt - to use it as a plugin, I should have used -plugin-sql-sqlite.
I think the seemingly random ever-changing nature of my errors was because I re-built the project in QtCreator without cleaning the build first.
I hope this helps anybody else in a similar situation.