{"id":463,"date":"2017-04-12T20:41:24","date_gmt":"2017-04-12T12:41:24","guid":{"rendered":"http:\/\/www.thinkmesh.net\/?p=463"},"modified":"2017-04-12T21:05:33","modified_gmt":"2017-04-12T13:05:33","slug":"linux%e4%b8%8bgcc%e5%92%8cg%e5%88%87%e6%8d%a2","status":"publish","type":"post","link":"http:\/\/www.thinkmesh.net\/?p=463","title":{"rendered":"Linux\u4e0bgcc\u548cg++\u5207\u6362"},"content":{"rendered":"<p><div  class=\"sc_act\">Linux\u7684gcc\u548cg++\u7248\u672c\u5728\u4e0d\u540c\u7cfb\u7edf\u4e2d\u4e0d\u540c\uff0c\u4e0b\u9762\u4e3b\u8981\u4ecb\u7ecd\u5982\u4f55\u624b\u52a8\u5207\u6362\u4e0d\u540c\u7248\u672c\u7684gcc\u548cg++\u3002<\/div><br \/>\n\u67e5\u770b\u7cfb\u7edf\u4e2dgcc\u548cg++\u7684\u7248\u672c\uff0c\u53ef\u91c7\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<br \/>\n<code>gcc -v<\/code>\u548c<code>g++ -v<\/code><br \/>\n\u5047\u8bbe\u7cfb\u7edf\u4e2d\u67094.4\u548c4.8\u4e24\u4e2a\u4e0d\u540c\u7248\u672c\u7684gcc\u548cg++\uff0c\u53ef\u5206\u522b\u91c7\u7528\u4e0b\u8ff0\u547d\u4ee4\u8fdb\u884c\u4e0d\u540c\u7248\u672c\u6dfb\u52a0\uff1a<\/p>\n<pre class=\"prettyprint linenums\" >\r\nsudo update-alternatives --install \/usr\/bin\/gcc gcc \/usr\/bin\/gcc-4.4 40\r\nsudo update-alternatives --install \/usr\/bin\/gcc gcc \/usr\/bin\/gcc-4.8 80\r\nsudo update-alternatives --install \/usr\/bin\/g++ g++ \/usr\/bin\/g++-4.4 40\r\nsudo update-alternatives --install \/usr\/bin\/g++ g++ \/usr\/bin\/g++-4.8 80\r\n<\/pre>\n<p>\u9009\u62e9\u4e0d\u540c\u7248\u672c\u7684gcc\u548cg++\uff0c\u53ef\u91c7\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre class=\"prettyprint linenums\" >\r\nsudo update-alternatives --config gcc\r\nsudo update-alternatives --config g++\r\n<\/pre>\n<p>\u5982\u679c\u60f3\u5220\u9664\u4e4b\u524d\u6dfb\u52a0\u7684gcc\u548cg++\u7684\u9009\u62e9\u9879\uff0c\u53ef\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4(\u59824.4)\uff1a<\/p>\n<pre class=\"prettyprint linenums\" >\r\nsudo update-alternatives --remove gcc \/usr\/bin\/gcc-4.4\r\nsudo update-alternatives --remove gcc \/usr\/bin\/g++-4.4\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u67e5\u770b\u7cfb\u7edf\u4e2dgcc\u548cg++\u7684\u7248\u672c\uff0c\u53ef\u91c7\u7528\u5982\u4e0b\u547d\u4ee4\uff1a gcc -v\u548cg++ -v \u5047\u8bbe\u7cfb\u7edf\u4e2d\u67094.4\u548c4.8\u4e24\u4e2a\u4e0d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[35],"_links":{"self":[{"href":"http:\/\/www.thinkmesh.net\/index.php?rest_route=\/wp\/v2\/posts\/463"}],"collection":[{"href":"http:\/\/www.thinkmesh.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.thinkmesh.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.thinkmesh.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.thinkmesh.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=463"}],"version-history":[{"count":10,"href":"http:\/\/www.thinkmesh.net\/index.php?rest_route=\/wp\/v2\/posts\/463\/revisions"}],"predecessor-version":[{"id":473,"href":"http:\/\/www.thinkmesh.net\/index.php?rest_route=\/wp\/v2\/posts\/463\/revisions\/473"}],"wp:attachment":[{"href":"http:\/\/www.thinkmesh.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.thinkmesh.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=463"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.thinkmesh.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}