Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing stl in an Android adb shell native program
    primarykey
    data
    text
    <p>I'm trying to port a C++ utility program that I want to be run from the Android ADB shell. For that, I'm using the Android NDK's make-standalone-toolchain.sh script, and compiling my program with it. Unfortunately, when I try to run it, I get this error:</p> <pre><code>reloc_library[1315]: 16304 cannot locate '_ZNKSs5c_strEv'... CANNOT LINK EXECUTABLE </code></pre> <p>After some research, I saw that this means that the c_str function doesn't exist in libstdc++.so in the NDK. I also couldn't find the symbol in stlport.so either, and actually only found it in the ./sources/cxx-stl/gnu-libstdc++/libs/ version of the C++ libraries. These libraries are not included in the standalone toolchain I made, and I also couldn't find them on the device (the device is running Honeycomb).</p> <p>The text in the NDK clearly states that there's support for the entire STL when I use stlport. Is this something that is only true in Ice Cream Sandwich? The libstlport.so or in libsupc++.so on the device and in the NDK didn't have any signature like the one that wasn't found.</p> <p>So my question has two parts:</p> <ol> <li>Is there something I'm missing in the build process/Android setup? Can I set up things differently so that the program will compile without needing the gnu-libstc++, or at least fail with a compilation/link error instead of failing to load on the device?</li> <li>If linking with gnu-libstc++ is the only way, how can I do that? I think I can manage statically link to it but I'd rather not.</li> </ol> <p>How can I add the gnu-libstdc++ version to my </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload