{"id":971,"date":"2014-10-21T17:08:35","date_gmt":"2014-10-21T09:08:35","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=971"},"modified":"2014-10-27T10:42:07","modified_gmt":"2014-10-27T02:42:07","slug":"ubuntu-14-04codeblocks-13-12%e6%9e%84%e5%bb%baarm%e4%ba%a4%e5%8f%89%e7%bc%96%e8%af%91%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=971","title":{"rendered":"Ubuntu 14.04+CodeBlocks 13.12\u6784\u5efaARM Linux+Andriod\u4ea4\u53c9\u7f16\u8bd1\u73af\u5883"},"content":{"rendered":"<p>\u6298\u817e\u4e86\u597d\u51e0\u5929\uff0c\u7f51\u4e0a\u7684\u8d44\u6599\u6bd4\u8f83\u6df7\u4e71\uff0c\u5b9e\u9645\u4e0a\u539f\u672c\u662f\u6bd4\u8f83\u7b80\u5355\u7684\u4e8b\u60c5\u3002\u4e0b\u9762\u7684\u914d\u7f6e\u6211\u6210\u529f\u7f16\u8bd1\u4e86\u6700\u7b80\u5355\u7684Helloworld\u7a0b\u5e8f\uff0c\u5e76\u5728Andriod\u548cUbuntu\u73af\u5883\u4e0b\u8fd0\u884c\uff0c\u8bc1\u660e\u914d\u7f6e\u662f\u57fa\u672c\u6b63\u786e\u7684\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5\u4ea4\u53c9\u7f16\u8bd1\u73af\u5883\u548cCodeBlocks\uff0c\u8fd9\u91cc\u5b89\u88c5\u4e86Linux\u7684C(gcc-arm-linux-gnueabihf)\/C++(g++-arm-linux-gnueabihf)\u7f16\u8bd1\u5668\u548cAndriod\u7684C(gcc-arm-linux-andriod)\u7684\u7f16\u8bd1\u5668\u3002Andriod\u7684\u7f16\u8bd1\u5668Ubuntu\u6ca1\u6709\u9884\u6253\u5305\u7684C++\u5e93\uff0c\u8c61iostream\u5565\u7684\u90fd\u6ca1\u6709:(\u3002<\/p>\n<pre class=\"lang:sh decode:true\">sudo apt-get install gcc-arm-linux-gnueabihf lzop libncurses5-dev g++-arm-linux-gnueabihf gcc-arm-linux-andriod codeblocks<\/pre>\n<p>\u7b2c\u4e8c\u6b65\uff1a\u7531\u4e8eCodeBlocks\u7684ARM\u7f16\u8bd1\u73af\u5883\u914d\u7f6e\u7684\u662farm-elf-gcc\/g++\u7b49\u540d\u79f0\uff0c\u800cUbuntu\u4e0a\u9762\u5b89\u88c5\u751f\u6210\u7684\u7f16\u8bd1\u5668\u5565\u7684\u53ebarm-linux-gnueabihf-gcc\uff0c\u524d\u7f00\u4e0d\u4e00\u6837\uff0c\u6240\u4ee5\u9700\u8981\u989d\u5916\u7684\u914d\u7f6e\uff0c\u4ee5\u4fbf\u5728CodeBlocks\u65f6\u8ba9\u5176\u80fd\u591f\u7f16\u8bd1\u3002<\/p>\n<p>\u6211\u4eec\u5148\u8bf4\u6709\u4e24\u79cd\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p>1\u3001\u4fee\u6539\u7f16\u8bd1\u5668\u914d\u7f6e<\/p>\n<p>1.1\u3001\u9009\u62e9GNU \u00a0GCC Compiler for ARM\uff0c\u7136\u540e\u4fee\u6539Toolchain executables\uff0c\u4fee\u6539\u4e3a\u4e0b\u56fe\u4e2d\u7684\u8bbe\u7f6e\u3002<\/p>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Compiler.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-972\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Compiler-300x225.jpg\" alt=\"CodeBlocks_Ubuntu_ARM_Compiler\" width=\"300\" height=\"225\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Compiler-300x225.jpg 300w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Compiler.jpg 843w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>1.2\u3001\u4fee\u6539\u5934\u6587\u4ef6\u641c\u7d22\u8def\u5f84Search directories-&gt;Compiler\u4e3a\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Search_Compiler.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-973\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Search_Compiler-300x226.jpg\" alt=\"CodeBlocks_Ubuntu_ARM_Search_Compiler\" width=\"300\" height=\"226\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Search_Compiler-300x226.jpg 300w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Search_Compiler.jpg 840w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>1.3\u3001\u4fee\u6539\u5e93\u6587\u4ef6\u641c\u7d22\u8def\u5f84Search directories-&gt;Linker\u4e3a\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Search_Linker.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-974\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Search_Linker-300x225.jpg\" alt=\"CodeBlocks_Ubuntu_ARM_Search_Linker\" width=\"300\" height=\"225\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Search_Linker-300x225.jpg 300w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2014\/10\/CodeBlocks_Ubuntu_ARM_Search_Linker.jpg 845w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>2\u3001\u5efa\u7acbCodeBlocks\u517c\u5bb9\u7684\u7b26\u53f7\u94fe\u63a5<\/p>\n<pre class=\"lang:sh decode:true\">cd \/usr\/bin\r\nsudo ln -s arm-linux-gnueabihf-gcc arm-elf-gcc\r\nsudo ln -s arm-linux-gnueabihf-g++ arm-elf-g++\r\nsudo ln -s arm-linux-gnueabihf-ar arm-elf-ar<\/pre>\n<p>\u4e0a\u9762\u7684\u6b65\u9aa4\u5b8c\u6210\u540e\uff0c\u6253\u5f00CodeBlocks\u5f00\u53d1\u73af\u5883\uff0c\u8ba9\u6211\u4eec\u73b0\u5728\u5c31\u521b\u5efa\u6211\u4eec\u7684\u7b2c\u4e00\u4e2aARM\u7a0b\u5e8f\u5427\u3002<\/p>\n<p>\u9009\u62e9New-&gt;Project-&gt;Console application\u5efa\u7acb\u63a7\u5236\u53f0\u7a0b\u5e8f\u6765\u6d4b\u8bd5\u4e0b\u6211\u4eec\u7684\u914d\u7f6e\u3002<\/p>\n<p>\u5411\u5bfc\u4e2d\u7684\u7f16\u8bd1\u5668\uff08Compiler\uff09\u9009\u62e9\u6211\u4eec\u521a\u624d\u8bbe\u7f6e\u7684GNU GCC Compiler for ARM\uff0c\u5269\u4e0b\u7684\u4e00\u8def\u4e0b\u4e00\u6b65\u6216\u8005\u6839\u636e\u9700\u8981\u4fee\u6539\u3002\u6700\u540e\u4f1a\u6709\u4e00\u4e2a\u8b66\u544a\uff0c\u6211\u8fd8\u6ca1\u6709\u7ec6\u7a76\u539f\u56e0\uff0c\u5148\u5ffd\u7565\u597d\u4e86\u3002<\/p>\n<p>\u8981\u5f00\u53d1Andriod\u7a0b\u5e8f\uff0c\u9700\u8981\u4f7f\u7528Andriod\u7684ARM\u7248\u7f16\u8bd1\u5668\uff0c\u4e0a\u9762\u6211\u4eec\u5df2\u7ecf\u5b89\u88c5\u4e86\uff0c\u53ea\u9700\u5c06Tool chains\u4e2d\u76f8\u5173\u7684\u7a0b\u5e8f\u6362\u6210arm-linux-andriodeabi-*\u5c31\u53ef\u4ee5\u4e86\u3002\u63a8\u8350\u65b0\u5efa\u4e00\u4e2a\u7f16\u8bd1\u5668\u914d\u7f6e\uff0c\u4fee\u6539\u76f8\u5173\u7684\u8bbe\u7f6e\u5c31\u597d\u3002<\/p>\n<p>\u73b0\u5728\u4e00\u4e2a\u7b80\u5355\u7684Hello,world\u7a0b\u5e8f\u5c31\u597d\u4e86\uff0c\u7f16\u8bd1\u7a0b\u5e8f\uff0c\u89c2\u5bdf\u8f93\u51fa\uff0c\u5982\u679c\u663e\u793a\u6b63\u786e\u7f16\u8bd1\uff0c\u8bf4\u660e\u6211\u4eec\u7684\u914d\u7f6e\u5c31\u6210\u529f\u4e86\u3002<\/p>\n<p>\u3010\u9644\u3011 \u767e\u5ea6\u5230\u7684\u4e00\u4e2a<a href=\"http:\/\/wenku.baidu.com\/link?url=VZOOwZKOZ-ssLzycvR8XXwY9_r01JgAI5dF-ecnRdoqsr9y6tFgT2BlxRARpuMv2hwa7SLviXzk-8rmSDnjPt0ja8uedqGtnUn7bQ14_KEq\">CodeBlocks \u8be6\u7ec6\u4f7f\u7528\u6559\u7a0b<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6298\u817e\u4e86\u597d\u51e0\u5929\uff0c\u7f51\u4e0a\u7684\u8d44\u6599\u6bd4\u8f83\u6df7\u4e71\uff0c\u5b9e\u9645\u4e0a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[21],"tags":[31,130,129,131],"class_list":["post-971","post","type-post","status-publish","format-standard","hentry","category-misc","tag-c","tag-codeblocks","tag-ubuntu","tag-131"],"views":13128,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=971"}],"version-history":[{"count":8,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/971\/revisions"}],"predecessor-version":[{"id":1028,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/971\/revisions\/1028"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}