A
A
Asya2017-04-27 15:11:53
Android
Asya, 2017-04-27 15:11:53

How to include the android boost library in Qt?

I downloaded CrystaX NDK , as I understand it, there are already compiled libraries that you just need to connect.

And I kind of connected them
QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = qt_test
TEMPLATE = app

INCLUDEPATH += C:/qt_projects/-----X-----/boost/1.59.0/include
LIBS += C:/qt_projects/-----X-----/boost/1.59.0/libs

DEFINES += QT_DEPRECATED_WARNINGS

CONFIG += c++14

SOURCES += main.cpp\
        mainwindow.cpp \
    graph.cpp \
    textrank.cpp

HEADERS  += mainwindow.h \
    graph.hpp \
    textrank.hpp

FORMS    += mainwindow.ui

contains(ANDROID_TARGET_ARCH,x86) {
    ANDROID_EXTRA_LIBS = \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_atomic.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_chrono.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_container.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_context.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_coroutine.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_date_time.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_filesystem.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_graph.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_iostreams.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_locale.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_log.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_log_setup.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_math_c99.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_math_c99f.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_math_c99l.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_math_tr1.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_math_tr1f.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_math_tr1l.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_prg_exec_monitor.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_program_options.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_python.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_python3.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_random.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_regex.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_serialization.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_signals.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_system.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_thread.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_timer.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_unit_test_framework.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_wave.so \
        C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/libboost_wserialization.so
}

but strange errors appear,
17d4b1fb998d453c94cf27d836dc4841.jpg
I can’t understand why permission is denied, everything seems to be ok with the rights
and nothing changes from transferring the boost folder either
Apparently I connected something wrong (?) Tell me how to fix it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Ariox41, 2017-04-28
@asyaevloeva

Under android did not work, but apparently the line

LIBS += C:/qt_projects/-----X-----/boost/1.59.0/libs
superfluous.
Maybe below you should write something like
contains(ANDROID_TARGET_ARCH,x86) {
    ANDROID_EXTRA_LIBS += \
        L"C:/qt_projects/-----X-----/boost/1.59.0/libs/x86/gnu-5/" \
        lboost_atomic \
        lboost_chrono \
        ..........
}
by analogy with the standard qmake addition to LIBS (Lpath is the path to the directory with libs, lname is the name of the library without lib and .so)
Also, you should not include all boost libs at once, you don’t need most of them.
And yes, boost and Qt get along great with each other.

J
Jacob E, 2017-04-27
@Zifix

Can you clearly explain why you need to interfere with boost and Qt?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question