Closed Alexorleon closed 8 years ago
First, you need to make a root .pro file of your project to use template = subdirs
and add CuteLogger before your project:
project.pro:
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += \
utils/CuteLogger \
app
Next, I've added common.pri to utils directory (since I use a lot of utilitary libraries in the project, including CuteLogger):
INCLUDEPATH += \
$$PWD/CuteLogger/include
LIBS += \
-L../CuteLogger
And now, the stripped-down app.pro based on autogenerated one made by Qt Creator:
TEMPLATE = app
QT += qml gui quick
SOURCES += main.cpp
INCLUDEPATH += \
$$PWD/../utils/CuteLogger/include
LIBS += -L../utils/CuteLogger -lLogger
# Default rules for deployment.
include(deployment.pri)
# Here goes ANDROID_PACKAGE_SOURCE_DIR, inclusion of AndroidManifest.xml etc.
...
There is no need to explicitly add libLogger.so to ANDROID_EXTRA_LIBS
variable, qmake will automatically handle all libraries included to the project.
Then we simply include Logger.h and AndroidAppender.h in main.cpp and add a single line of code:
logger->registerAppender(new AndroidAppender);
Hope that helps.
Good afternoon! Thank you for a great module! I built it and connected to the project. Ubuntu. Everything is working.
Now I would like to try it on android device.
But the error occurs: undefined reference to 'ConsoleAppender::ConsoleAppender()'
Please tell me how to connect the library to the application for android?