Note that there are some explanatory texts on larger screens.

plurals
  1. POunsatisfied link error on android when using STL in natives (NDK) while using standalone toolchain
    primarykey
    data
    text
    <p>I am getting unsatisfied link error when I'm trying to launch my C++ based app on Android. The problem only appear if I use any of STL mechanism, when I comment out all <code>std::vector</code> etc. the problem disappears.</p> <p>EDIT: I found out that this is about all C++, not only STL (ie. <code>new operator</code> also cause unsatisfied link error)</p> <p>I am using custom, standalone toolchain to build binary (targeting android 1.6), and link it with <code>libstdc++.a</code>, <code>libGLESv1_CM.a</code>, <code>liblog.a</code> and <code>libm.a</code>.</p> <p>In Java I call:</p> <pre><code>static { System.loadLibrary("GLESv1_CM"); System.loadLibrary("Game"); } </code></pre> <p>The exact build order is:</p> <pre><code>engine_sources -&gt; libengine.a game_sources + libengine.a + all mentioned libraries (using --whole-archive for each) -&gt; libGame.so Java_framework + libGame.so -&gt; Game.apk </code></pre> <p>Is there something I'm missing?</p> <p>Edit2: As suggested in <a href="http://mpigulski.blogspot.com/2010/09/debugging-dlopen-unsatisfiedlinkerror.html" rel="nofollow">http://mpigulski.blogspot.com/2010/09/debugging-dlopen-unsatisfiedlinkerror.html</a> I run <code>arm-linux-androideabi-ld.exe libGame.so</code> and got this:</p> <pre><code>arm-linux-androideabi-ld.exe: warning: cannot find entry symbol _start; defaulting to 00008270 libGame.so: undefined reference to `__aeabi_fadd' libGame.so: undefined reference to `__aeabi_fcmpgt' libGame.so: undefined reference to `__aeabi_i2f' libGame.so: undefined reference to `__aeabi_dmul' libGame.so: undefined reference to `__aeabi_d2f' libGame.so: undefined reference to `vtable for OpenGLRenderer' libGame.so: undefined reference to `__aeabi_fsub' libGame.so: undefined reference to `__aeabi_idiv' libGame.so: undefined reference to `__aeabi_fdiv' libGame.so: undefined reference to `__aeabi_uidiv' libGame.so: undefined reference to `__aeabi_fcmpeq' libGame.so: undefined reference to `__aeabi_fmul' libGame.so: undefined reference to `__aeabi_fcmplt' libGame.so: undefined reference to `__aeabi_f2d' </code></pre> <p>I am especially concerned about</p> <pre><code>libGame.so: undefined reference to `vtable for OpenGLRenderer' </code></pre> <p><code>OpenGLRenderer</code> is a child of abstract class which I am creating with <code>new</code>. Am I missing something here?</p>
    singulars
    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.
    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