Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Building Qt Android app with an external lib (Assimp)

    Mobile and Embedded
    android libraries libs
    2
    7
    2866
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Sergobot last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        What exactly doesn't work ?

        If it's linking you are missing

        LIBS += -lassimp

        in your pro file

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        S 1 Reply Last reply Reply Quote 0
        • S
          Sergobot @SGaist last edited by

          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

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by SGaist

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

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            S 1 Reply Last reply Reply Quote 0
            • S
              Sergobot @SGaist last edited by

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

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

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

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                S 1 Reply Last reply Reply Quote 0
                • S
                  Sergobot @SGaist last edited by Sergobot

                  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?

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post