problems adding external library Eigen

Sysprogs forums Forums VisualGDB problems adding external library Eigen

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #716
    jetzi06
    Participant

    Hello,

    I want to develop a Android app which should use a shared c++ library.

    So i have created a new VisualGDB Android Project with the option “Create a new App with simple native library”. The App works well and i can execute the application on my android device.

    Additionally i want to use an extern math library called “Eigen”. I have set the path to the library (sources) via include directories of the project and via VisualGDB Makefie (LOCAL_C_INCLUDES :=C:/Development/android/eigen-eigen-ffa86ffb5570) .

    When i want to build the project i get some errors:
    Error 2 error : unknown type name ‘namespace’ C:Developmentandroideigen-eigen-ffa86ffb5570Eigen\srcCoreutilMacros.h 172 6 SpeechRecognizer
    Error 3 error : expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{‘ token C:Developmentandroideigen-eigen-ffa86ffb5570Eigen\srcCoreutilMacros.h 172 22 SpeechRecognizer
    Error 4 error : complex: No such file or directory C:Developmentandroideigen-eigen-ffa86ffb5570Eigen\Core 28 20 SpeechRecognizer

    Do you know a solution for the problem? Is there a tutorial for adding external c++ librariers?

    Best Regards,
    Thomas

    #2878
    ket
    Participant

    Hi,

    Just adding the include directory is not enough to use the library, the shared library needs to be included in the app package and deployed together with it. Also, how to do this differs on Android from usual gcc projects.

    We have a tutorial on making library-only projects with VisualGDB and adding those libraries to app projects:
    http://visualgdb.com/tutorials/android/library/

    If in your case you just have the built library already without a project, then just the points 8 and 12 are important in your case. You should add a System.loadLibrary call as in step 8 and PREBUILT_SHARED_LIBRARY block (with your library paths) with LOCAL_SHARED_LIBRARIES specified as in step 12.

    Please also note that the library you use must have been previously built targeting the Android OS.

    #2877
    jetzi06
    Participant

    Hi,

    But Eigen is a header-only library. I’ve implemented the library in a standard android ndk project, and it works. The only change was a modification of the Android.mk –> LOCAL_C_INCLUDES := $(NDK_APP_PROJECT_PATH)jnieigen

    Regards,
    Thomas

    #2876
    ket
    Participant

    Hi,

    Do you mean that you have fixed the issue? The LOCAL_C_INCLUDES can be specified identically in Android.mk and in our Makefile settings gui as the graphical interface is directly tied to the Android.mk file.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.