{"id":358,"date":"2012-02-09T00:29:34","date_gmt":"2012-02-08T16:29:34","guid":{"rendered":"http:\/\/guoh.ai\/lifelog\/?p=358"},"modified":"2012-02-09T00:29:34","modified_gmt":"2012-02-08T16:29:34","slug":"things-about-android-ndk","status":"publish","type":"post","link":"https:\/\/guoh.ai\/lifelog\/2012\/02\/things-about-android-ndk\/","title":{"rendered":"Android NDK\u6742\u8bb0"},"content":{"rendered":"<div class=\"gfmr-markdown-container\"><div class=\"gfmr-markdown-source\" style=\"display: none;\">&lt;p&gt;Android NDK&lt;br \/&gt;\n\u5728\u4f7f\u7528Android NDK\u7684\u65f6\u5019\u5f53\u7136\u90fd\u4f1a\u7528\u5230ndk-build\u8fd9\u4e2a\u547d\u4ee4&lt;br \/&gt;\n\u5e38\u7528\u53c2\u6570\u6709-B\u548cV=1&lt;\/p&gt;\n&lt;p&gt;\u66f4\u591a\u4fe1\u606f\u53c2\u89c1\u6587\u6863&lt;br \/&gt;\n$NDK_HOME\/documentation.html&lt;br \/&gt;\n\u6216\u8005\u8ba8\u8bba\u7ec4http:\/\/groups.google.com\/group\/android-ndk&lt;\/p&gt;\n&lt;p&gt;\u8fd9\u91cc\u7b80\u5355\u8bb0\u5f55\u4e00\u6b21NDK\u7248\u672c\u5347\u7ea7\u7684\u8fc7\u7a0b&lt;br \/&gt;\n\u4ecer4b\u5347\u7ea7\u5230r7\uff0c\u4f7f\u7528\u4e86\u5f88\u957f\u65f6\u95f4\u7684r4b\u4e4b\u540e\u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u9700\u8981\u5347\u7ea7\u5230r7&lt;br \/&gt;\n\u4f46\u662f\u76f4\u63a5\u5c31\u62a5\u51fa\u4e86&lt;br \/&gt;\nIn function `xxx_foo&#8217;:src_file_name.cc:error_line: undefined reference to `call_foo&#8217;&lt;br \/&gt;\n\u4f46\u662f\u6211\u4eec\u5f15\u7528\u7684head file\u548cstatic library\u90fd\u5728\uff0c\u800c\u4e14\u5728r4b\u4e0b\u90fd\u53ef\u4ee5build\u6210\u529f&lt;\/p&gt;\n&lt;p&gt;&lt;strong&gt;ndk-build\u5206\u4e3a\u4e09\u4e2a\u6b65\u9aa4\uff1acompile\uff0clink\uff0cinstall&lt;\/strong&gt;&lt;\/p&gt;\n&lt;p&gt;\u4e8e\u662f\u5f00\u59cb\u5bfb\u6c42\u89e3\u51b3\u529e\u6cd5\uff0c\u4e00\u4f4d\u540c\u4e8b\u601d\u8def\u6bd4\u8f83\u6e05\u6670\u3002&lt;br \/&gt;\n\u56e0\u4e3ar4b\u53ef\u4ee5build pass\u4f46\u662fr7\u5374\u5728link\u65f6\u5019\u62a5\u51fa\u9519\u8bef\uff0c\u6240\u4ee5\u4ed6\u6bd4\u8f83\u4e86\u4e24\u4e2a\u7248\u672c\u7684ndk-build\u5bf9\u76f8\u540cmk\u6587\u4ef6\u751f\u6210\u7684\u7f16\u8bd1\u6307\u4ee4\u3002&lt;br \/&gt;\n\u53d1\u73b0r7\u751f\u6210\u7684\u6307\u4ee4\u7f3a\u5c11\u4e86\u4e00\u4e2a\u53c2\u6570&lt;br \/&gt;\n-Wl &#8211;whole-archive -Wl &#8211;no-whole-archive static_library_path.a&lt;br \/&gt;\n\u4e8e\u662f\u4ed6\u8865\u5145\u4e0a\u8fd9\u4e2a\u53c2\u6570\u5728cmd line\u8fdb\u884c\u624b\u52a8\u6267\u884c\u547d\u4ee4link\uff0c\u53d1\u73b0\u53ef\u4ee5link\u6210\u529f\uff0c\u4e8e\u662f\u786e\u5b9a\u95ee\u9898\u51fa\u5728\u54ea\u91cc\u3002&lt;br \/&gt;\n\u53c2\u7167NDK document\u4ed6\u52a0\u4e0a\u4e86\u4e00\u4e2ainclude\uff0c\u5373include $(PREBUILT_STATIC_LIBRARY)\u628a\u95ee\u9898\u89e3\u51b3\u4e86\uff0c\u76ee\u524d\u8fd8\u6ca1\u6709\u6bd4\u8f83\u6df1\u5165\u7684\u770b\u8fd9\u5757\u3002&lt;br \/&gt;\n\u4f46\u662f\u89c9\u5f97\u89e3\u6389\u8fd9\u4e2a\u95ee\u9898\u7684\u65b9\u6cd5\u503c\u5f97\u5b66\u4e60\u3002&lt;\/p&gt;\n<\/div><div class=\"gfmr-markdown-rendered\"><p>Android NDK<br \/>\n\u5728\u4f7f\u7528Android NDK\u7684\u65f6\u5019\u5f53\u7136\u90fd\u4f1a\u7528\u5230ndk-build\u8fd9\u4e2a\u547d\u4ee4<br \/>\n\u5e38\u7528\u53c2\u6570\u6709-B\u548cV=1<\/p>\n<p>\u66f4\u591a\u4fe1\u606f\u53c2\u89c1\u6587\u6863<br \/>\n$NDK_HOME\/documentation.html<br \/>\n\u6216\u8005\u8ba8\u8bba\u7ec4http:\/\/groups.google.com\/group\/android-ndk<\/p>\n<p>\u8fd9\u91cc\u7b80\u5355\u8bb0\u5f55\u4e00\u6b21NDK\u7248\u672c\u5347\u7ea7\u7684\u8fc7\u7a0b<br \/>\n\u4ecer4b\u5347\u7ea7\u5230r7\uff0c\u4f7f\u7528\u4e86\u5f88\u957f\u65f6\u95f4\u7684r4b\u4e4b\u540e\u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u9700\u8981\u5347\u7ea7\u5230r7<br \/>\n\u4f46\u662f\u76f4\u63a5\u5c31\u62a5\u51fa\u4e86<br \/>\nIn function `xxx_foo&#8217;:src_file_name.cc:error_line: undefined reference to `call_foo&#8217;<br \/>\n\u4f46\u662f\u6211\u4eec\u5f15\u7528\u7684head file\u548cstatic library\u90fd\u5728\uff0c\u800c\u4e14\u5728r4b\u4e0b\u90fd\u53ef\u4ee5build\u6210\u529f<\/p>\n<p><strong>ndk-build\u5206\u4e3a\u4e09\u4e2a\u6b65\u9aa4\uff1acompile\uff0clink\uff0cinstall<\/strong><\/p>\n<p>\u4e8e\u662f\u5f00\u59cb\u5bfb\u6c42\u89e3\u51b3\u529e\u6cd5\uff0c\u4e00\u4f4d\u540c\u4e8b\u601d\u8def\u6bd4\u8f83\u6e05\u6670\u3002<br \/>\n\u56e0\u4e3ar4b\u53ef\u4ee5build pass\u4f46\u662fr7\u5374\u5728link\u65f6\u5019\u62a5\u51fa\u9519\u8bef\uff0c\u6240\u4ee5\u4ed6\u6bd4\u8f83\u4e86\u4e24\u4e2a\u7248\u672c\u7684ndk-build\u5bf9\u76f8\u540cmk\u6587\u4ef6\u751f\u6210\u7684\u7f16\u8bd1\u6307\u4ee4\u3002<br \/>\n\u53d1\u73b0r7\u751f\u6210\u7684\u6307\u4ee4\u7f3a\u5c11\u4e86\u4e00\u4e2a\u53c2\u6570<br \/>\n-Wl &#8211;whole-archive -Wl &#8211;no-whole-archive static_library_path.a<br \/>\n\u4e8e\u662f\u4ed6\u8865\u5145\u4e0a\u8fd9\u4e2a\u53c2\u6570\u5728cmd line\u8fdb\u884c\u624b\u52a8\u6267\u884c\u547d\u4ee4link\uff0c\u53d1\u73b0\u53ef\u4ee5link\u6210\u529f\uff0c\u4e8e\u662f\u786e\u5b9a\u95ee\u9898\u51fa\u5728\u54ea\u91cc\u3002<br \/>\n\u53c2\u7167NDK document\u4ed6\u52a0\u4e0a\u4e86\u4e00\u4e2ainclude\uff0c\u5373include $(PREBUILT_STATIC_LIBRARY)\u628a\u95ee\u9898\u89e3\u51b3\u4e86\uff0c\u76ee\u524d\u8fd8\u6ca1\u6709\u6bd4\u8f83\u6df1\u5165\u7684\u770b\u8fd9\u5757\u3002<br \/>\n\u4f46\u662f\u89c9\u5f97\u89e3\u6389\u8fd9\u4e2a\u95ee\u9898\u7684\u65b9\u6cd5\u503c\u5f97\u5b66\u4e60\u3002<\/p>\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>&lt;p&gt;Android NDK&lt;br \/&gt; \u5728\u4f7f\u7528Android NDK\u7684\u65f6\u5019\u5f53\u7136\u90fd\u4f1a\u7528\u5230ndk-build\u8fd9\u4e2a\u547d\u4ee4&lt;br \/&gt; \u5e38\u7528\u53c2\u6570\u6709-B\u548cV=1&lt;\/p&gt; &lt;p&gt;\u66f4\u591a\u4fe1\u606f\u53c2\u89c1\u6587\u6863&lt;br \/&gt; $NDK_HOME\/documentation.html&lt;br \/&gt; \u6216\u8005\u8ba8\u8bba\u7ec4http:\/\/groups.google.com\/group\/android-ndk&lt;\/p&gt; &lt;p&gt;\u8fd9\u91cc\u7b80\u5355\u8bb0\u5f55\u4e00\u6b21NDK\u7248\u672c\u5347\u7ea7\u7684\u8fc7\u7a0b&lt;br \/&gt; \u4ecer4b\u5347\u7ea7\u5230r7\uff0c\u4f7f\u7528\u4e86\u5f88\u957f\u65f6\u95f4\u7684r4b\u4e4b\u540e\u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u9700\u8981\u5347\u7ea7\u5230r7&lt;br \/&gt; \u4f46\u662f\u76f4\u63a5\u5c31\u62a5\u51fa\u4e86&lt;br \/&gt; In function `xxx_foo&#8217;:src_file_name.cc:error_line: undefined reference to `call_foo&#8217;&lt;br \/&gt; \u4f46\u662f\u6211\u4eec\u5f15\u7528\u7684head file\u548cstatic library\u90fd\u5728\uff0c\u800c\u4e14\u5728r4b\u4e0b\u90fd\u53ef\u4ee5build\u6210\u529f&lt;\/p&gt; &lt;p&gt;&lt;strong&gt;ndk-build\u5206\u4e3a\u4e09\u4e2a\u6b65\u9aa4\uff1acompile\uff0clink\uff0cinstall&lt;\/strong&gt;&lt;\/p&gt; &lt;p&gt;\u4e8e\u662f\u5f00\u59cb\u5bfb\u6c42\u89e3\u51b3\u529e\u6cd5\uff0c\u4e00\u4f4d\u540c\u4e8b\u601d\u8def\u6bd4\u8f83\u6e05\u6670\u3002&lt;br \/&gt; \u56e0\u4e3ar4b\u53ef\u4ee5build pass\u4f46\u662fr7\u5374\u5728link\u65f6\u5019\u62a5\u51fa\u9519\u8bef\uff0c\u6240\u4ee5\u4ed6\u6bd4\u8f83\u4e86\u4e24\u4e2a\u7248\u672c\u7684ndk-build\u5bf9\u76f8\u540cmk\u6587\u4ef6\u751f\u6210\u7684\u7f16\u8bd1\u6307\u4ee4\u3002&lt;br \/&gt; \u53d1\u73b0r7\u751f\u6210\u7684\u6307\u4ee4\u7f3a\u5c11\u4e86\u4e00\u4e2a\u53c2\u6570&lt;br \/&gt; -Wl &#8211;whole-archive -Wl &#8211;no-whole-archive static_library_path.a&lt;br \/&gt; \u4e8e\u662f\u4ed6\u8865\u5145\u4e0a\u8fd9\u4e2a\u53c2\u6570\u5728cmd line\u8fdb\u884c\u624b\u52a8\u6267\u884c\u547d\u4ee4link\uff0c\u53d1\u73b0\u53ef\u4ee5link\u6210\u529f\uff0c\u4e8e\u662f\u786e\u5b9a\u95ee\u9898\u51fa\u5728\u54ea\u91cc\u3002&lt;br \/&gt; \u53c2\u7167NDK document\u4ed6\u52a0\u4e0a\u4e86\u4e00\u4e2ainclude\uff0c\u5373include $(PREBUILT_STATIC_LIBRARY)\u628a\u95ee\u9898\u89e3\u51b3\u4e86\uff0c\u76ee\u524d\u8fd8\u6ca1\u6709\u6bd4\u8f83\u6df1\u5165\u7684\u770b\u8fd9\u5757\u3002&lt;br \/&gt; \u4f46\u662f\u89c9\u5f97\u89e3\u6389\u8fd9\u4e2a\u95ee\u9898\u7684\u65b9\u6cd5\u503c\u5f97\u5b66\u4e60\u3002&lt;\/p&gt; Android NDK \u5728\u4f7f\u7528Android NDK\u7684\u65f6\u5019\u5f53\u7136\u90fd\u4f1a\u7528\u5230ndk-build\u8fd9\u4e2a\u547d\u4ee4 &hellip; <a href=\"https:\/\/guoh.ai\/lifelog\/2012\/02\/things-about-android-ndk\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Android NDK\u6742\u8bb0<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gfmr_meta_descriptions":[],"_gfmr_multilingual_taxonomy_terms":[],"footnotes":""},"categories":[7],"tags":[20],"class_list":["post-358","post","type-post","status-publish","format-standard","hentry","category-android","tag-ndk"],"_links":{"self":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/comments?post=358"}],"version-history":[{"count":2,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/358\/revisions"}],"predecessor-version":[{"id":360,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/358\/revisions\/360"}],"wp:attachment":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/media?parent=358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/categories?post=358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/tags?post=358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}