Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android App Development include LDAP on MAC OS X
QtWS25 Last Chance

Android App Development include LDAP on MAC OS X

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
25 Posts 4 Posters 4.8k Views
  • 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.
  • M Offline
    M Offline
    mkmp29
    wrote on 28 Mar 2018, 12:00 last edited by
    #1

    I want to add the ldap framework, which is located in xcode under /System/Library/Frameworks/LDAP.framework, to my qt application. The app should generate a android application.

    I tried it first on a normal console application generated with qt. It works with the following .pro file:

    QT -= gui
    
    CONFIG += c++11 console
    CONFIG -= app_bundle
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which as been marked deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += main.cpp \
        ldapAuth.cpp \
        user.cpp
    
    HEADERS += \
        ldapAuth.h \
        user.h
    
    mac: LIBS += -framework LDAP
    

    After that I wanted to port it to the android application, but the compiler don't find the included ldap.h in my file.

    # ekke (Ekkehard Gentz) @ekkescorner
    TEMPLATE = app
    TARGET = stacked_pages_x
    
    QT += qml quick core sql
    CONFIG += c++11
    CONFIG -= app_bundle
    
    mac: LIBS += -F/System/Library/Frameworks/LDAP.framework
    mac: LIBS += -framework LDAP
    
    HEADERS += \
        applicationui.hpp \
        uiconstants.hpp \
        handlenewstudent.h \
        entities/admin.h \
        dbhelper.h \
        entities/student.h \
        ldapAuth.h
    
    SOURCES += main.cpp \
        applicationui.cpp \
        handlenewstudent.cpp \
        entities/admin.cpp \
        dbhelper.cpp \
        entities/student.cpp \
        ldapAuth.cpp
    
    lupdate_only {
        SOURCES +=  main.qml \
        common/*.qml \
        pages/*.qml
    }
    
    OTHER_FILES += images/black/*.png \
        images/black/x18/*.png \
        images/black/x36/*.png \
        images/black/x48/*.png \
        images/white/*.png \
        images/white/x18/*.png \
        images/white/x36/*.png \
        images/white/x48/*.png \
        translations/*.* \
        images/LICENSE \
        LICENSE \
        *.md
    
    RESOURCES += \
        translations.qrc \
        qml.qrc \
        images.qrc
    
    # Additional import path used to resolve QML modules in Qt Creator's code model
    QML_IMPORT_PATH =
    
    # Default rules for deployment.
    include(deployment.pri)
    
    # T R A N S L A T I O N S
    
    # if languages are added:
    # 1. rebuild project to generate *.qm
    # 2. add existing .qm files to translations.qrc
    
    # if changes to translatable strings:
    # 1. Run Tools-External-Linguist-Update
    # 2. Run Linguist and do translations
    # 3. Build and run on iOS and Android to verify translations
    # 4. Optional: if translations not done: Run Tools-External-Linguist-Release
    
    # Supported languages
    LANGUAGES = de en
    
    # used to create .ts files
     defineReplace(prependAll) {
         for(a,$$1):result += $$2$${a}$$3
         return($$result)
     }
    # Available translations
    tsroot = $$join(TARGET,,,.ts)
    tstarget = $$join(TARGET,,,_)
    TRANSLATIONS = $$PWD/translations/$$tsroot
    TRANSLATIONS += $$prependAll(LANGUAGES, $$PWD/translations/$$tstarget, .ts)
    # run LRELEASE to generate the qm files
    qtPrepareTool(LRELEASE, lrelease)
     for(tsfile, TRANSLATIONS) {
         command = $$LRELEASE $$tsfile
         system($$command)|error("Failed to run: $$command")
     }
    
    DISTFILES += \
        pages/PageStudentNew.qml \
        pages/PageItemOverview.qml \
        pages/PageItemNew.qml \
        pages/PageHome.qml \
        pages/PageUserOverview.qml \
        pages/PageUserNew.qml \
        pages/PageBorrowedItemsOverview.qml \
        pages/PageBorrowItem.qml \
        pages/PageGiveBackItem.qml \
        pages/PageLogin.qm
    

    QT can't find the library, which is located in the ldap.h data.

    What can I do to get it done ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 28 Mar 2018, 12:07 last edited by
      #2

      @mkmp29 said in Android App Development include LDAP on MAC OS X:

      mac: LIBS += -F/System/Library/Frameworks/LDAP.framework
      mac: LIBS += -framework LDAP

      You are only including the framework on Mac.

      In order to include a lib for Android, you need to:

      • cross-compile that library using Android NDK
      • import it in your .pro file
      • if the library is a shared lib, you also need to add it to ANDROID_EXTRA_LIBS

      (Z(:^

      1 Reply Last reply
      5
      • M Offline
        M Offline
        mkmp29
        wrote on 29 Mar 2018, 14:09 last edited by mkmp29 4 Feb 2018, 18:20
        #3

        I compiled the framework with this script:

        #!/bin/bash
        
        #adjust
        export NDK_LOCATION="/Users/user123/Library/Android/sdk"
        
        export ANDROID_NDK_HOME="$NDK_LOCATION/ndk-bundle"
        export CC="arm-linux-androideabi-gcc"
        export CXX="arm-linux-androideabi-g++"
        export RANLIB="arm-linux-androideabi-ranlib"
        export LD="arm-linux-androideabi-ld"
        export AR="arm-linux-androideabi-ar"
        export CROSS_COMPILE="arm-linux-androideabi"
        #define android api
        export ANDROID_API=16
        export CFLAGS="-D__ANDROID_API__=$ANDROID_API"
        
        #install toolchain
        ${ANDROID_NDK_HOME}/build/tools/make-standalone-toolchain.sh --platform=android-${ANDROID_API} --install-dir=${ANDROID_NDK_HOME}/android-toolchain
        
        export PATH="$PATH:$ANDROID_NDK_HOME/android-toolchain/bin"
        export LIB_DIR="`pwd`/lib"
        export LDAP_OUTPUT_DIR="${LIB_DIR}/compiled/OpenLDAP"
        
        #download lib
        #git clone https://github.com/openldap/openldap.git
        cd "$LIB_DIR/openldap"
        
        ./configure --host=${CROSS_COMPILE} --prefix="${LDAP_OUTPUT_DIR}" --with-yielding_select=yes
        
        make depend
        make && make install
        

        And tried to add it in my pro file:

        # ekke (Ekkehard Gentz) @ekkescorner
        TEMPLATE = app
        TARGET = stacked_pages_x
        
        QT += qml quick core sql
        CONFIG += c++11
        
        INCLUDEPATH += lib/compiled/OpenLDAP/include
        LIBS += -L lib/compiled/OpenLDAP/lib -lldap
        ANDROID_EXTRA_LIBS += lib/compiled/OpenLDAP/lib/libldap.so
        
        HEADERS += \
            handlenewstudent.h \
            applicationui.hpp \
            uiconstants.hpp \
            entities/admin.h \
            dbhelper.h \
            entities/student.h \
            handletextfield.h \
            lists/studentlist.h \
            entities/studentlistmodel.h\
            ldapAuth.h
        
        SOURCES += main.cpp \
            applicationui.cpp \
            entities/admin.cpp \
            dbhelper.cpp \
            entities/student.cpp \
            handletextfield.cpp \
            lists/studentlist.cpp \
            entities/studentlistmodel.cpp\
            ldapAuth.cpp \
            handlenewstudent.cpp
        
        lupdate_only {
            SOURCES +=  main.qml \
            common/*.qml \
            pages/*.qml
        }
        
        OTHER_FILES += images/black/*.png \
            images/black/x18/*.png \
            images/black/x36/*.png \
            images/black/x48/*.png \
            images/white/*.png \
            images/white/x18/*.png \
            images/white/x36/*.png \
            images/white/x48/*.png \
            translations/*.* \
            images/LICENSE \
            LICENSE \
            *.md
        
        RESOURCES += \
            translations.qrc \
            qml.qrc \
            images.qrc
        
        # Additional import path used to resolve QML modules in Qt Creator's code model
        QML_IMPORT_PATH =
        
        # Default rules for deployment.
        include(deployment.pri)
        
        # T R A N S L A T I O N S
        
        # if languages are added:
        # 1. rebuild project to generate *.qm
        # 2. add existing .qm files to translations.qrc
        
        # if changes to translatable strings:
        # 1. Run Tools-External-Linguist-Update
        # 2. Run Linguist and do translations
        # 3. Build and run on iOS and Android to verify translations
        # 4. Optional: if translations not done: Run Tools-External-Linguist-Release
        
        # Supported languages
        LANGUAGES = de en
        
        # used to create .ts files
         defineReplace(prependAll) {
             for(a,$$1):result += $$2$${a}$$3
             return($$result)
         }
        # Available translations
        tsroot = $$join(TARGET,,,.ts)
        tstarget = $$join(TARGET,,,_)
        TRANSLATIONS = $$PWD/translations/$$tsroot
        TRANSLATIONS += $$prependAll(LANGUAGES, $$PWD/translations/$$tstarget, .ts)
        # run LRELEASE to generate the qm files
        qtPrepareTool(LRELEASE, lrelease)
         for(tsfile, TRANSLATIONS) {
             command = $$LRELEASE $$tsfile
             system($$command)|error("Failed to run: $$command")
         }
        
        DISTFILES += \
            pages/PageStudentNew.qml \
            pages/PageItemOverview.qml \
            pages/PageItemNew.qml \
            pages/PageHome.qml \
            pages/PageUserOverview.qml \
            pages/PageUserNew.qml \
            pages/PageBorrowedItemsOverview.qml \
            pages/PageBorrowItem.qml \
            pages/PageGiveBackItem.qml \
            pages/PageLogin.qml
        

        But it still don't work, it throws errors that functions are not in the declared scope

        /Edit: solved it, I used deprecated functionality of the library that can be enabled over the macro LDAP_DEPRECATED

        S 1 Reply Last reply 30 Mar 2018, 06:03
        1
        • M mkmp29
          29 Mar 2018, 14:09

          I compiled the framework with this script:

          #!/bin/bash
          
          #adjust
          export NDK_LOCATION="/Users/user123/Library/Android/sdk"
          
          export ANDROID_NDK_HOME="$NDK_LOCATION/ndk-bundle"
          export CC="arm-linux-androideabi-gcc"
          export CXX="arm-linux-androideabi-g++"
          export RANLIB="arm-linux-androideabi-ranlib"
          export LD="arm-linux-androideabi-ld"
          export AR="arm-linux-androideabi-ar"
          export CROSS_COMPILE="arm-linux-androideabi"
          #define android api
          export ANDROID_API=16
          export CFLAGS="-D__ANDROID_API__=$ANDROID_API"
          
          #install toolchain
          ${ANDROID_NDK_HOME}/build/tools/make-standalone-toolchain.sh --platform=android-${ANDROID_API} --install-dir=${ANDROID_NDK_HOME}/android-toolchain
          
          export PATH="$PATH:$ANDROID_NDK_HOME/android-toolchain/bin"
          export LIB_DIR="`pwd`/lib"
          export LDAP_OUTPUT_DIR="${LIB_DIR}/compiled/OpenLDAP"
          
          #download lib
          #git clone https://github.com/openldap/openldap.git
          cd "$LIB_DIR/openldap"
          
          ./configure --host=${CROSS_COMPILE} --prefix="${LDAP_OUTPUT_DIR}" --with-yielding_select=yes
          
          make depend
          make && make install
          

          And tried to add it in my pro file:

          # ekke (Ekkehard Gentz) @ekkescorner
          TEMPLATE = app
          TARGET = stacked_pages_x
          
          QT += qml quick core sql
          CONFIG += c++11
          
          INCLUDEPATH += lib/compiled/OpenLDAP/include
          LIBS += -L lib/compiled/OpenLDAP/lib -lldap
          ANDROID_EXTRA_LIBS += lib/compiled/OpenLDAP/lib/libldap.so
          
          HEADERS += \
              handlenewstudent.h \
              applicationui.hpp \
              uiconstants.hpp \
              entities/admin.h \
              dbhelper.h \
              entities/student.h \
              handletextfield.h \
              lists/studentlist.h \
              entities/studentlistmodel.h\
              ldapAuth.h
          
          SOURCES += main.cpp \
              applicationui.cpp \
              entities/admin.cpp \
              dbhelper.cpp \
              entities/student.cpp \
              handletextfield.cpp \
              lists/studentlist.cpp \
              entities/studentlistmodel.cpp\
              ldapAuth.cpp \
              handlenewstudent.cpp
          
          lupdate_only {
              SOURCES +=  main.qml \
              common/*.qml \
              pages/*.qml
          }
          
          OTHER_FILES += images/black/*.png \
              images/black/x18/*.png \
              images/black/x36/*.png \
              images/black/x48/*.png \
              images/white/*.png \
              images/white/x18/*.png \
              images/white/x36/*.png \
              images/white/x48/*.png \
              translations/*.* \
              images/LICENSE \
              LICENSE \
              *.md
          
          RESOURCES += \
              translations.qrc \
              qml.qrc \
              images.qrc
          
          # Additional import path used to resolve QML modules in Qt Creator's code model
          QML_IMPORT_PATH =
          
          # Default rules for deployment.
          include(deployment.pri)
          
          # T R A N S L A T I O N S
          
          # if languages are added:
          # 1. rebuild project to generate *.qm
          # 2. add existing .qm files to translations.qrc
          
          # if changes to translatable strings:
          # 1. Run Tools-External-Linguist-Update
          # 2. Run Linguist and do translations
          # 3. Build and run on iOS and Android to verify translations
          # 4. Optional: if translations not done: Run Tools-External-Linguist-Release
          
          # Supported languages
          LANGUAGES = de en
          
          # used to create .ts files
           defineReplace(prependAll) {
               for(a,$$1):result += $$2$${a}$$3
               return($$result)
           }
          # Available translations
          tsroot = $$join(TARGET,,,.ts)
          tstarget = $$join(TARGET,,,_)
          TRANSLATIONS = $$PWD/translations/$$tsroot
          TRANSLATIONS += $$prependAll(LANGUAGES, $$PWD/translations/$$tstarget, .ts)
          # run LRELEASE to generate the qm files
          qtPrepareTool(LRELEASE, lrelease)
           for(tsfile, TRANSLATIONS) {
               command = $$LRELEASE $$tsfile
               system($$command)|error("Failed to run: $$command")
           }
          
          DISTFILES += \
              pages/PageStudentNew.qml \
              pages/PageItemOverview.qml \
              pages/PageItemNew.qml \
              pages/PageHome.qml \
              pages/PageUserOverview.qml \
              pages/PageUserNew.qml \
              pages/PageBorrowedItemsOverview.qml \
              pages/PageBorrowItem.qml \
              pages/PageGiveBackItem.qml \
              pages/PageLogin.qml
          

          But it still don't work, it throws errors that functions are not in the declared scope

          /Edit: solved it, I used deprecated functionality of the library that can be enabled over the macro LDAP_DEPRECATED

          S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 30 Mar 2018, 06:03 last edited by
          #4

          @mkmp29 said in Android App Development include LDAP on MAC OS X:

          But it still don't work, it throws errors that functions are not in the declared scope

          What errors and where?

          This line looks fishy to me: --host=${CROSS_COMPILE}

          The host is your host machine (your Mac), so it should rather be something like x86_64, and not the ARM architecture. But maybe LDAP is using some other convention, I don't know.

          (Z(:^

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mkmp29
            wrote on 2 Apr 2018, 11:09 last edited by mkmp29 4 Feb 2018, 18:18
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • M Offline
              M Offline
              mkmp29
              wrote on 2 Apr 2018, 18:49 last edited by
              #6

              My error is:

              :-1: error: error: cannot find -lldap
              

              I think there is mistake in the .pro file:

              The Filestructure is:

              - *.pro
              - lib
                - compiled
                  - OpenLDAP
                     - lib
                     - include 
                     - *
              - other files 
              

              in the lib directory are these files:

              liblber-2-devel.so.0       libldap.la
              liblber-2-devel.so.0.0.0   libldap.so
              liblber.a                  libldap_r-2-devel.so.0
              liblber.la                 libldap_r-2-devel.so.0.0.0
              liblber.so                 libldap_r.a
              libldap-2-devel.so.0       libldap_r.la
              libldap-2-devel.so.0.0.0   libldap_r.so
              libldap.a
              
              1 Reply Last reply
              0
              • S Offline
                S Offline
                sierdzio
                Moderators
                wrote on 4 Apr 2018, 09:58 last edited by
                #7

                @mkmp29 said in Android App Development include LDAP on MAC OS X:

                -L lib/compiled/OpenLDAP/lib -lldap

                There should be no space between '-L' and your library search path.

                (Z(:^

                1 Reply Last reply
                1
                • M Offline
                  M Offline
                  mkmp29
                  wrote on 4 Apr 2018, 13:09 last edited by mkmp29 4 Apr 2018, 13:09
                  #8

                  @mkmp29 said in Android App Development include LDAP on MAC OS X:

                  INCLUDEPATH += lib/compiled/OpenLDAP/include
                  LIBS += -L lib/compiled/OpenLDAP/lib -lldap
                  ANDROID_EXTRA_LIBS += lib/compiled/OpenLDAP/lib/libldap.so

                  Didn't work either. I just get the message for multiple lib function:

                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::~LDAPAuth(): error: undefined reference to 'ldap_unbind'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::~LDAPAuth(): error: undefined reference to 'ldap_unbind'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::checkStatus(QString const&, int): error: undefined reference to 'ldap_err2string'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::checkStatus(QString const&, int): error: undefined reference to 'ldap_err2string'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::init(): error: undefined reference to 'ldap_initialize'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::init(): error: undefined reference to 'ldap_initialize'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::init(): error: undefined reference to 'ldap_set_option'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::init(): error: undefined reference to 'ldap_set_option'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::init(): error: undefined reference to 'ldap_start_tls_s'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::init(): error: undefined reference to 'ldap_start_tls_s'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::init(): error: undefined reference to 'ldap_simple_bind_s'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::search(QString const&): error: undefined reference to 'ldap_search_ext_s'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::search(QString const&): error: undefined reference to 'ldap_first_entry'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::search(QString const&): error: undefined reference to 'ldap_get_dn'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::search(QString const&): error: undefined reference to 'ldap_first_attribute'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::search(QString const&): error: undefined reference to 'ldap_get_values'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::search(QString const&): error: undefined reference to 'ldap_next_attribute'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::search(QString const&): error: undefined reference to 'ldap_memfree'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::search(QString const&): error: undefined reference to 'ldap_next_entry'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::search(QString const&): error: undefined reference to 'ldap_msgfree'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::search(QString const&): error: undefined reference to 'ldap_msgfree'
                  ldapAuth.o:ldapAuth.cpp:function LDAPAuth::authentificate(QString const&, QString const&): error: undefined reference to 'ldap_simple_bind_s'
                  collect2: error: ld returned 1 exit status
                  

                  Looks like the library is compiled wrong ?

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 4 Apr 2018, 21:58 last edited by SGaist 4 Oct 2018, 20:20
                    #9

                    Hi,

                    Did you check the x86 vs x86_64 architecture for your library ?

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

                    M 2 Replies Last reply 10 Apr 2018, 16:23
                    0
                    • S SGaist
                      4 Apr 2018, 21:58

                      Hi,

                      Did you check the x86 vs x86_64 architecture for your library ?

                      M Offline
                      M Offline
                      mkmp29
                      wrote on 10 Apr 2018, 16:23 last edited by
                      #10

                      @SGaist
                      I can only compile the library for the arm architecture. Other architecture fail because they can't find libraries...

                      Is there a better solution than compile the library for every architecture of the enddevice?

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 10 Apr 2018, 20:21 last edited by
                        #11

                        No there's not.

                        The only alternative is to check whether your targets already have them available in their root filesystem and re-use them.

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

                        M 1 Reply Last reply 14 Apr 2018, 10:01
                        0
                        • S SGaist
                          10 Apr 2018, 20:21

                          No there's not.

                          The only alternative is to check whether your targets already have them available in their root filesystem and re-use them.

                          M Offline
                          M Offline
                          mkmp29
                          wrote on 14 Apr 2018, 10:01 last edited by
                          #12
                          This post is deleted!
                          1 Reply Last reply
                          0
                          • S SGaist
                            4 Apr 2018, 21:58

                            Hi,

                            Did you check the x86 vs x86_64 architecture for your library ?

                            M Offline
                            M Offline
                            mkmp29
                            wrote on 14 Apr 2018, 15:35 last edited by
                            #13

                            @SGaist

                            I can compile the application and push it to the virtual device. But i get the error:

                            W System.err: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "liblber-2-devel.so.0" not found
                            

                            This file is contained in the lib folder of my cross compiled library. I read a little bit and tried to load the library during runtime with the QT Object: QLibrary and the function load. But it didnt work.

                            this is the part of my .pro file

                            ANDROID_EXTRA_LIBS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/libldap.so
                            ANDROID_EXTRA_LIBS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/liblber.so
                            ANDROID_EXTRA_LIBS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/libldap_r.so
                            #ANDROID_EXTRA_LIBS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/liblber-2-devel.so.0
                            #ANDROID_EXTRA_LIBS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/liblber-2-devel.so.0.0.0
                            #ANDROID_EXTRA_LIBS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/libldap-2-devel.so.0
                            #ANDROID_EXTRA_LIBS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/libldap-2-devel.so.0.0.0
                            #ANDROID_EXTRA_LIBS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/libldap_r-2-devel.so.0
                            #ANDROID_EXTRA_LIBS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/libldap_r-2-devel.so.0.0.0
                            
                            LIBS += -L$$PWD/lib/compiled/openldap-i686-linux-android_16/lib/ -lldap
                            
                            INCLUDEPATH += $$PWD/lib/compiled/openldap-i686-linux-android_16/include
                            DEPENDPATH += $$PWD/lib/compiled/openldap-i686-linux-android_16/include
                            
                            PRE_TARGETDEPS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/libldap.a
                            LIBS += -L$$PWD/lib/compiled/openldap-i686-linux-android_16/lib/ -llber
                            
                            INCLUDEPATH += $$PWD/lib/compiled/openldap-i686-linux-android_16/include
                            DEPENDPATH += $$PWD/lib/compiled/openldap-i686-linux-android_16/include
                            
                            PRE_TARGETDEPS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/liblber.a
                            
                            LIBS += -L$$PWD/lib/compiled/openldap-i686-linux-android_16/lib/ -lldap_r
                            
                            INCLUDEPATH += $$PWD/lib/compiled/openldap-i686-linux-android_16/include
                            DEPENDPATH += $$PWD/lib/compiled/openldap-i686-linux-android_16/include
                            
                            PRE_TARGETDEPS += $$PWD/lib/compiled/openldap-i686-linux-android_16/lib/libldap_r.a
                            

                            Library loading at the beginning of the main method.

                                QLibrary ldap("ldap");
                                QLibrary ldap_r("ldap_r");
                                QLibrary lber("lber");
                            
                                if(!ldap.load() || !lber.load() || !ldap_r.load()){
                                    qDebug() << "Failed loading library";
                                }
                            
                            

                            The libraries that are contained in the lib folder are listed above

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 14 Apr 2018, 20:31 last edited by
                              #14

                              IIRC, android doesn't support library versioning so ensure that you don't have a symbolic link copied to your package but a copy of the library.

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

                              M 2 Replies Last reply 15 Apr 2018, 13:37
                              1
                              • S SGaist
                                14 Apr 2018, 20:31

                                IIRC, android doesn't support library versioning so ensure that you don't have a symbolic link copied to your package but a copy of the library.

                                M Offline
                                M Offline
                                mkmp29
                                wrote on 15 Apr 2018, 13:37 last edited by mkmp29
                                #15
                                This post is deleted!
                                1 Reply Last reply
                                0
                                • S SGaist
                                  14 Apr 2018, 20:31

                                  IIRC, android doesn't support library versioning so ensure that you don't have a symbolic link copied to your package but a copy of the library.

                                  M Offline
                                  M Offline
                                  mkmp29
                                  wrote on 15 Apr 2018, 19:54 last edited by
                                  #16

                                  @SGaist said in Android App Development include LDAP on MAC OS X:

                                  IIRC, android doesn't support library versioning so ensure that you don't have a symbolic link copied to your package but a copy of the library.

                                  I removed the links from the libraries, deleted the links and renamed the lib to its original name, but the error still appears...

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 15 Apr 2018, 20:11 last edited by
                                    #17

                                    Which one ? The missing symbol or the dlopen error ?

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

                                    M 1 Reply Last reply 17 Apr 2018, 15:39
                                    0
                                    • S SGaist
                                      15 Apr 2018, 20:11

                                      Which one ? The missing symbol or the dlopen error ?

                                      M Offline
                                      M Offline
                                      mkmp29
                                      wrote on 17 Apr 2018, 15:39 last edited by
                                      #18

                                      @SGaist

                                      the dlopen error.

                                      I also tried to copy the versioned libs into the same folder in the android libs directory. But it didn't work.

                                      1 Reply Last reply
                                      0
                                      • S Offline
                                        S Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on 17 Apr 2018, 20:26 last edited by
                                        #19

                                        Why are you dlopening the library on Android rather than linking to it ?

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

                                        M 1 Reply Last reply 19 Apr 2018, 07:29
                                        0
                                        • S SGaist
                                          17 Apr 2018, 20:26

                                          Why are you dlopening the library on Android rather than linking to it ?

                                          M Offline
                                          M Offline
                                          mkmp29
                                          wrote on 19 Apr 2018, 07:29 last edited by
                                          #20

                                          @SGaist

                                          this does the the library... I only include the library into my project

                                          S 1 Reply Last reply 19 Apr 2018, 21:09
                                          0

                                          9/25

                                          4 Apr 2018, 21:58

                                          topic:navigator.unread, 16
                                          • Login

                                          • Login or register to search.
                                          9 out of 25
                                          • First post
                                            9/25
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved