Note that there are some explanatory texts on larger screens.

plurals
  1. POError building protocol buffer with the Android NDK
    primarykey
    data
    text
    <p>I try to build the protocol buffer library in the Android NDK (full lib). (<a href="https://stackoverflow.com/questions/7144008/how-to-build-protocol-buffer-by-android-ndk">How to build protocol buffer by Android NDK</a>). But when I execute <code>ndk-build</code>, I get an error</p> <pre><code>... Compile++ thumb : protobuf &lt;= printer.cc Compile++ thumb : protobuf &lt;= tokenizer.cc Compile++ thumb : protobuf &lt;= zero_copy_stream_impl.cc Compile++ thumb : protobuf &lt;= importer.cc Compile++ thumb : protobuf &lt;= parser.cc SharedLibrary : libprotobuf.so jni/src/google/protobuf/io/tokenizer.cc:928: error: undefined reference to 'google::protobuf::StringAppendF(std::string*, char const*, ...)' collect2: error: ld returned 1 exit status make: *** [obj/local/armeabi/libprotobuf.so] Error 1 </code></pre> <p>This is source code contains error:</p> <pre><code>... // Helper to append a Unicode code point to a string as UTF8, without bringing // in any external dependencies. static void AppendUTF8(uint32 code_point, string* output) { uint32 tmp = 0; int len = 0; if (code_point &lt;= 0x7f) { tmp = code_point; len = 1; } else if (code_point &lt;= 0x07ff) { tmp = 0x0000c080 | ((code_point &amp; 0x07c0) &lt;&lt; 2) | (code_point &amp; 0x003f); len = 2; } else if (code_point &lt;= 0xffff) { tmp = 0x00e08080 | ((code_point &amp; 0xf000) &lt;&lt; 4) | ((code_point &amp; 0x0fc0) &lt;&lt; 2) | (code_point &amp; 0x003f); len = 3; } else if (code_point &lt;= 0x1fffff) { tmp = 0xf0808080 | ((code_point &amp; 0x1c0000) &lt;&lt; 6) | ((code_point &amp; 0x03f000) &lt;&lt; 4) | ((code_point &amp; 0x000fc0) &lt;&lt; 2) | (code_point &amp; 0x003f); len = 4; } else { // UTF-16 is only defined for code points up to 0x10FFFF, and UTF-8 is // normally only defined up to there as well. StringAppendF(output, "\\U%08x", code_point); //&lt;---- This error string return; } tmp = ghtonl(tmp); output-&gt;append(reinterpret_cast&lt;const char*&gt;(&amp;tmp) + sizeof(tmp) - len, len); } ... </code></pre> <p>If this line is commented out, it compiles. How to solve this problem?</p> <p>PS: <code>protobuf_lite_static</code>, <code>protobuf_static</code> and <code>protobuf_lite_shared</code> build successfully.</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.
 

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