I want to geocode addresses with C++ and wanted to use the QtLocation and Qtpositioning stuff. I thought the first step was to create a QGeoAddress. But this does not work. I'm getting a LNK2019 failure. It would be great if you could help me!
#include <QCoreApplication>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <regex>
#include <string>
#include <streambuf>
#include <QtPositioning/QGeoAddress.h>
#include <QtPositioning/QGeoLocation>
#include <QtLocation/QGeoCodingManager>
#include <QtLocation/QGeoServiceProvider>
#include <QString>
#include <QtLocation/QGeoCodeReply>
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QGeoAddress searchAddress;
}
The error message is (I'm sorry that it is in german):
main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: __cdecl QGeoAddress::QGeoAddress(void)" (__imp_??0QGeoAddress@@QEAA@XZ)" in Funktion "main".
main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: __cdecl QGeoAddress::~QGeoAddress(void)" (__imp_??1QGeoAddress@@QEAA@XZ)" in Funktion "main".
debug\Regex_GeoModA_Qt.exe : fatal error LNK1120: 2 nicht aufgelöste Externe