View Single Post
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#103
Originally Posted by rinigus View Post
Very-very simple (instructions have not been tested in real life, correct as needed):

* clone recursively https://github.com/rinigus/pkg-mapbox-gl-native

* make subdir build

* copy mapbox-gl-native-lib.pro to mapbox-gl-native subdir

* in build subdir, qmake5 ../mapbox-gl-native/mapbox-gl-native-lib.pro

* make -jXX

* clone https://github.com/rinigus/mapbox-gl-qml

* open in QtCreator mapbox-gl-qml/app/mapbox-qml.pro

* Adjust mapbox-qml.pro (https://github.com/rinigus/mapbox-gl...ox-qml.pro#L12 ) INCLUDEPATH and LIBS to point to pkg-mapbox-gl-native/build and pkg-mapbox-gl-native/mapbox-gl-native location accordingly.
Got as far as this but it's wont compile, complaining about some sqlite3.cpp errors:

Code:
01:28:34: Running steps for project mapbox-qml...
01:28:34: Configuration unchanged, skipping qmake step.
01:28:34: Starting: "/usr/bin/make" 
g++  -o mapbox-qml main.o qquickitemmapboxgl.o qsgmapboxglnode.o qsgtextureplain.o qmapboxsync.o qrc_qml.o moc_qquickitemmapboxgl.o moc_qsgmapboxglnode.o moc_qsgtextureplain.o   -L../../pkg-mapbox-gl-native/build -lqmapboxgl -lz -lQt5Location -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Positioning -lQt5Core -lGL -lpthread 
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::checkQueryError(QSqlQuery const&)':
sqlite3.cpp:(.text+0x16a): undefined reference to `QSqlQuery::lastError() const'
sqlite3.cpp:(.text+0x172): undefined reference to `QSqlError::type() const'
sqlite3.cpp:(.text+0x17e): undefined reference to `QSqlError::~QSqlError()'
sqlite3.cpp:(.text+0x1a8): undefined reference to `QSqlError::nativeErrorCode() const'
sqlite3.cpp:(.text+0x1ca): undefined reference to `QSqlError::text() const'
sqlite3.cpp:(.text+0x238): undefined reference to `QSqlError::~QSqlError()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::checkDatabaseError(QSqlDatabase const&)':
sqlite3.cpp:(.text+0x2aa): undefined reference to `QSqlDatabase::lastError() const'
sqlite3.cpp:(.text+0x2b2): undefined reference to `QSqlError::type() const'
sqlite3.cpp:(.text+0x2be): undefined reference to `QSqlError::~QSqlError()'
sqlite3.cpp:(.text+0x2e8): undefined reference to `QSqlError::nativeErrorCode() const'
sqlite3.cpp:(.text+0x30a): undefined reference to `QSqlError::text() const'
sqlite3.cpp:(.text+0x378): undefined reference to `QSqlError::~QSqlError()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::checkDatabaseOpenError(QSqlDatabase const&)':
sqlite3.cpp:(.text+0x3e2): undefined reference to `QSqlDatabase::lastError() const'
sqlite3.cpp:(.text+0x3ea): undefined reference to `QSqlError::type() const'
sqlite3.cpp:(.text+0x3f6): undefined reference to `QSqlError::~QSqlError()'
sqlite3.cpp:(.text+0x44e): undefined reference to `QSqlError::~QSqlError()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::Database::~Database()':
sqlite3.cpp:(.text+0x4a2): undefined reference to `QSqlDatabase::close()'
sqlite3.cpp:(.text+0x4ba): undefined reference to `QSqlDatabase::~QSqlDatabase()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::Statement::Statement(mapbox::sqlite::Database*, char const*)':
sqlite3.cpp:(.text+0x53f): undefined reference to `QSqlDatabase::QSqlDatabase(QSqlDatabase const&)'
sqlite3.cpp:(.text+0x54a): undefined reference to `QSqlQuery::QSqlQuery(QSqlDatabase)'
sqlite3.cpp:(.text+0x555): undefined reference to `QSqlDatabase::~QSqlDatabase()'
sqlite3.cpp:(.text+0x572): undefined reference to `QSqlQuery::setForwardOnly(bool)'
sqlite3.cpp:(.text+0x580): undefined reference to `QSqlQuery::prepare(QString const&)'
sqlite3.cpp:(.text+0x5e1): undefined reference to `QSqlQuery::~QSqlQuery()'
sqlite3.cpp:(.text+0x60c): undefined reference to `QSqlDatabase::~QSqlDatabase()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::Statement::~Statement()':
sqlite3.cpp:(.text+0x66d): undefined reference to `QSqlQuery::clear()'
sqlite3.cpp:(.text+0x675): undefined reference to `QSqlQuery::~QSqlQuery()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `void mapbox::sqlite::Statement::bind<decltype(nullptr)>(int, decltype(nullptr))':
sqlite3.cpp:(.text+0x6ce): undefined reference to `QSqlQuery::bindValue(int, QVariant const&, QFlags<QSql::ParamTypeFlag>)'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::Statement::bind(int, char const*, unsigned long, bool)':
sqlite3.cpp:(.text+0x7d7): undefined reference to `QSqlQuery::bindValue(int, QVariant const&, QFlags<QSql::ParamTypeFlag>)'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::Statement::bindBlob(int, void const*, unsigned long, bool)':
sqlite3.cpp:(.text+0x92e): undefined reference to `QSqlQuery::bindValue(int, QVariant const&, QFlags<QSql::ParamTypeFlag>)'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::Statement::run()':
sqlite3.cpp:(.text+0x9ef): undefined reference to `QSqlQuery::isValid() const'
sqlite3.cpp:(.text+0xa04): undefined reference to `QSqlQuery::setForwardOnly(bool)'
sqlite3.cpp:(.text+0xa0c): undefined reference to `QSqlQuery::exec()'
sqlite3.cpp:(.text+0xa24): undefined reference to `QSqlQuery::lastInsertId() const'
sqlite3.cpp:(.text+0xa66): undefined reference to `QSqlQuery::numRowsAffected() const'
sqlite3.cpp:(.text+0xa74): undefined reference to `QSqlQuery::next()'
sqlite3.cpp:(.text+0xa8c): undefined reference to `QSqlQuery::next()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `std::vector<unsigned char, std::allocator<unsigned char> > mapbox::sqlite::Statement::get<std::vector<unsigned char, std::allocator<unsigned char> > >(int)':
sqlite3.cpp:(.text+0xaf1): undefined reference to `QSqlQuery::value(int) const'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1l> > > mapbox::sqlite::Statement::get<std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1l> > > >(int)':
sqlite3.cpp:(.text+0xca7): undefined reference to `QSqlQuery::value(int) const'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `std::experimental::fundamentals_v1::optional<long> mapbox::sqlite::Statement::get<std::experimental::fundamentals_v1::optional<long> >(int)':
sqlite3.cpp:(.text+0xd2a): undefined reference to `QSqlQuery::value(int) const'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `std::experimental::fundamentals_v1::optional<double> mapbox::sqlite::Statement::get<std::experimental::fundamentals_v1::optional<double> >(int)':
sqlite3.cpp:(.text+0xdea): undefined reference to `QSqlQuery::value(int) const'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > mapbox::sqlite::Statement::get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(int)':
sqlite3.cpp:(.text+0xeb1): undefined reference to `QSqlQuery::value(int) const'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o):sqlite3.cpp:(.text+0xf91): more undefined references to `QSqlQuery::value(int) const' follow
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::Database::setBusyTimeout(std::chrono::duration<long, std::ratio<1l, 1000l> >)':
sqlite3.cpp:(.text+0x1219): undefined reference to `QSqlDatabase::connectOptions() const'
sqlite3.cpp:(.text+0x12e7): undefined reference to `QSqlDatabase::isOpen() const'
sqlite3.cpp:(.text+0x12f6): undefined reference to `QSqlDatabase::close()'
sqlite3.cpp:(.text+0x1304): undefined reference to `QSqlDatabase::setConnectOptions(QString const&)'
sqlite3.cpp:(.text+0x130f): undefined reference to `QSqlDatabase::open()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::Database::Database(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
sqlite3.cpp:(.text+0x14ae): undefined reference to `QSqlDatabase::drivers()'
sqlite3.cpp:(.text+0x153c): undefined reference to `QSqlDatabase::addDatabase(QString const&, QString const&)'
sqlite3.cpp:(.text+0x155b): undefined reference to `QSqlDatabase::~QSqlDatabase()'
sqlite3.cpp:(.text+0x15a1): undefined reference to `QSqlDatabase::connectOptions() const'
sqlite3.cpp:(.text+0x1678): undefined reference to `QSqlDatabase::setConnectOptions(QString const&)'
sqlite3.cpp:(.text+0x16a8): undefined reference to `QSqlDatabase::setDatabaseName(QString const&)'
sqlite3.cpp:(.text+0x16d4): undefined reference to `QSqlDatabase::open()'
sqlite3.cpp:(.text+0x18a2): undefined reference to `QSqlDatabase::~QSqlDatabase()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::Database::exec(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
sqlite3.cpp:(.text+0x1b15): undefined reference to `QSqlDatabase::QSqlDatabase(QSqlDatabase const&)'
sqlite3.cpp:(.text+0x1b20): undefined reference to `QSqlQuery::QSqlQuery(QSqlDatabase)'
sqlite3.cpp:(.text+0x1b28): undefined reference to `QSqlDatabase::~QSqlDatabase()'
sqlite3.cpp:(.text+0x1b35): undefined reference to `QSqlQuery::setForwardOnly(bool)'
sqlite3.cpp:(.text+0x1b40): undefined reference to `QSqlQuery::prepare(QString const&)'
sqlite3.cpp:(.text+0x1b48): undefined reference to `QSqlQuery::exec()'
sqlite3.cpp:(.text+0x1b5c): undefined reference to `QSqlQuery::~QSqlQuery()'
sqlite3.cpp:(.text+0x1c23): undefined reference to `QSqlQuery::~QSqlQuery()'
sqlite3.cpp:(.text+0x1c38): undefined reference to `QSqlDatabase::~QSqlDatabase()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `mapbox::sqlite::Statement::reset()':
sqlite3.cpp:(.text+0x1184): undefined reference to `QSqlQuery::finish()'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `void mapbox::sqlite::Statement::bind<long>(int, long)':
sqlite3.cpp:(.text._ZN6mapbox6sqlite9Statement4bindIlEEviT_[_ZN6mapbox6sqlite9Statement4bindIlEEviT_]+0x3f): undefined reference to `QSqlQuery::bindValue(int, QVariant const&, QFlags<QSql::ParamTypeFlag>)'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `bool mapbox::sqlite::Statement::get<bool>(int)':
sqlite3.cpp:(.text._ZN6mapbox6sqlite9Statement3getIbEET_i[_ZN6mapbox6sqlite9Statement3getIbEET_i]+0x17): undefined reference to `QSqlQuery::value(int) const'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `int mapbox::sqlite::Statement::get<int>(int)':
sqlite3.cpp:(.text._ZN6mapbox6sqlite9Statement3getIiEET_i[_ZN6mapbox6sqlite9Statement3getIiEET_i]+0x17): undefined reference to `QSqlQuery::value(int) const'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `long mapbox::sqlite::Statement::get<long>(int)':
sqlite3.cpp:(.text._ZN6mapbox6sqlite9Statement3getIlEET_i[_ZN6mapbox6sqlite9Statement3getIlEET_i]+0x17): undefined reference to `QSqlQuery::value(int) const'
../../pkg-mapbox-gl-native/build/libqmapboxgl.a(sqlite3.o): In function `double mapbox::sqlite::Statement::get<double>(int)':
sqlite3.cpp:(.text._ZN6mapbox6sqlite9Statement3getIdEET_i[_ZN6mapbox6sqlite9Statement3getIdEET_i]+0x17): undefined reference to `QSqlQuery::value(int) const'
collect2: error: ld returned 1 exit status
make: *** [Makefile:193: mapbox-qml] Error 1
01:28:35: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project mapbox-qml (kit: Fedora Qt 5)
The kit Fedora Qt 5 has configuration issues which might be the root cause for this problem.
When executing step "Make"
01:28:35: Elapsed time: 00:01.
I have both github repositories checked out in the same folders, so I've changed the paths in the .pro file (hopefully) accordingly:

Code:
INCLUDEPATH += ../../pkg-mapbox-gl-native/mapbox-gl-native/platform/qt/include ../../pkg-mapbox-gl-native/mapbox-gl-native/include
LIBS += -L ../../pkg-mapbox-gl-native/build -lqmapboxgl -lz
If I understand it correctly it fails during linking so maybe my mapbox-native-gl is compiled incorrectly or something ? It seem to compile without issues though during the earlier steps.
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)