Include & Lib paths for NDK

Sysprogs forums Forums VisualGDB Include & Lib paths for NDK

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #629
    Thirg
    Participant

    Hi,

    Trying out VisualGDB with Android NDK, but I’m having some difficulty creating the sample app.

    I had a couple of issues, the first was unable to locate any header files (i.e. sting.h):

    AndroidProject3jniAndroidProject3.c(19,20): fatal error : string.h: No such file or directory

    So I added the NDK arm include path to the Android.mk file.

    LOCAL_C_INCLUDES := E:/android-ndk-r9/platforms/android-18/arch-arm/usr/include

    But I’ve now ran into some link problems:

    1>E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe : error : cannot open crtbegin_so.o: No such file or directory
    1>E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe : error : cannot open crtend_so.o: No such file or directory
    1>E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe : error : cannot find -lstdc++
    1>E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe : error : cannot find -lm
    1>E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe : error : cannot find -lc
    1>E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe : error : cannot find -lc
    1>E:/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe : error : cannot find -ldl

    I’ve tried adding the library path to LOCAL_STATIC_LIBRARIES, or even adding each file via the LDFLAGS ( -gc-sections E:/android-ndk-r9/platforms/android-18/arch-arm/usr/lib/crtbegin_so.o ) but no luck with either.

    Any ideas what’s wrong? I’d of assumed there should be some way of getting these paths set dependant on the target chipset?

    Thanks! πŸ™‚

    #2601
    support
    Keymaster

    Hi,

    Thanks for reporting this. It is a bug in VisualGDB 4.0r3. Please go to VisualGDB Project Properties, Build Settings page and change Targeted Android Platform from android-15 to android-18. We will release a fix resolving this issue in VisualGDB 4.0r4.

    #2600
    ket
    Participant

    VisualGDB version 4.0r4 has now been released including a fix for this issue.

    #2602
    Thirg
    Participant

    Thanks! That fixed the compile / link problem πŸ˜€

    I have now hit a snag with the “Using Visual Studio to Develop Native Android Code” example though, the breakpoint fails to be hit.

    The App runs fine on the simulated device, “Your have pressed this huge button X times” etc.

    The command / output window shows this:

    E:android-ndk-r9toolchainsarm-linux-androideabi-4.6prebuiltwindows-x86_64binarm-linux-androideabi-gdb.exe –interpreter mi “C:UsersDave JohnsonAppDataLocalVisualGDBAndroidBinaryCacheemulator-AndroidVD1app_process” -x “C:WorkAndroidProject4AndroidProject4libsarmeabi-v7agdb.setup”
    No symbol table is loaded. Use the “file” command.
    VisualGDB for Android is trying to repair your breakpoints…

    Any idea how I can get the breakpoints working?

    Thanks! πŸ™‚

    #2603
    ket
    Participant

    Hi,

    Please try reloading the symbols (step 6 of this tutorial shows where to open that window). Make sure you are debugging the Debug configuration. Also try using a real device.

    If that doesn’t work, then give us your full gdb log. In order to get a full log, please enable diagnostic logging in the GDB settings page of VisualGDB Project Properties. Then start debugging, replicate your scenario, stop debugging, send us the gdb log file from your project directory.

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