I'm trying to develop an Standalone Application with Qt and QGIS API.
There are several code examples that should work, but they don't.
The Problem is that everytime I use "QgsApplication" the application Output says: "The program has unexpectedly finished."
Even this simple code does not work:
#include "mainwindow.h"
#include <QApplication>
#include "qgsapplication.h"
int main(int argc, char *argv[])
{
QgsApplication app(argc, argv, true);
}
My Project.pro file:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Project
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
LIBS += -L"C:/QGIS Building/lib" -lqgis_core -lqgis_gui
INCLUDEPATH += "C:/QGIS Building/include"
DEFINES += CORE_EXPORT=""
DEFINES += GUI_EXPORT=""