Building Qt Android app with an external lib (Assimp)



  • Hello everybody
    I have built assimp for Android but can't use it in my project. Searching in Google doesn't help. I tried adding this code to my .pro file:

    android {
        INCLUDEPATH += $$PWD/../3rdparty/assimp-3.1.1/include
        DEPENDPATH += $$PWD/../3rdparty/assimp-3.1.1/include
    
        ASSIMP_PATH = $$PWD/../3rdparty/assimp-3.1.1/
        assimp.path = /libs/armeabi-v7a
        assimp.files = $$ASSIMP_PATH/libassimp.so
        INSTALLS += assimp
    }
    

    but it doesn't work.
    So, how to add an external Android library to a Qt project?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What exactly doesn't work ?

    If it's linking you are missing

    LIBS += -lassimp

    in your pro file



  • Hello SGaist,
    I added
    LIBS += -L$$PWD/../3rdparty/assimp-3.1.1/ -lassimp
    to my .pro but still can't compile it because compiler gives me the same error as before:
    error: assimp/Importer.hpp: No such file or directory #include "assimp/Importer.hpp"
    which is really strange because the INCLUDEPATH variable is right and works when I use it for building for other platforms.
    Adding
    LIBS += -lassimp
    doesn't help too


  • Lifetime Qt Champion

    Are you sure that $PWD/../3rdparty/assimp-3.1.1/include point to the right location ?



  • Yes, of course, it works when I build for other platforms.


  • Lifetime Qt Champion

    Are you also using $PWD/../3rdparty/assimp-3.1.1/include for the other platforms ?



  • Almost yes.
    Now I use $$PWD/../3rdparty/assimp-3.1.1/include(2x '$') for all platforms, including Android, but I still can't build my .pro for it. For using $PWD I should set it to the right value in Projects->Build Environment, for each kit separately, right?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.