{"id":15606,"date":"2008-12-18T23:34:24","date_gmt":"2008-12-18T15:34:24","guid":{"rendered":"https:\/\/www.fuhaijun.com\/?p=15606"},"modified":"2008-12-18T23:34:24","modified_gmt":"2008-12-18T15:34:24","slug":"gcc%e4%bd%bf%e7%94%a8%e6%89%8b%e5%86%8c","status":"publish","type":"post","link":"https:\/\/www.fuhaijun.com\/?p=15606","title":{"rendered":"GCC\u4f7f\u7528\u624b\u518c"},"content":{"rendered":"<div id=\"Published By Juziyue-[4]1_CA8937DEBAED41D686D72EC6F5FCF6D6_32C667B4B0FC41B5A95DCE7AECDBE1E6\">\n<p>1.\u524d\u8a00&nbsp;<\/p>\n<p>&nbsp; &nbsp; GCC\u7f16\u8bd1\u5668\u7684\u624b\u518c(GCC MANUAL)\u7684\u82f1\u6587\u7248\u5df2\u7ecf\u975e\u5e38\u5168\u9762\uff0c\u5e76\u4e14\u7ed3\u6784\u4e5f\u975e\u5e38\u5b8c\u5584\u4e86\uff0c\u53ea\u662f\u4e00\u76f4\u90fd\u6ca1\u6709\u4e2d\u6587\u7684\u7248\u672c\uff0c\u6211\u8fd9\u6b21\u9605\u8bfb\u4e86GCC\u7f16\u8bd1\u5668\u7684\u4e3b\u8981\u5185\u5bb9\uff0c\u5bf9\u624b\u518c\u7684\u5185\u5bb9\u8fdb\u884c\u4e86\u7ed3\u6784\u6027\u7684\u4e86\u89e3\uff0c\u8ba4\u4e3a\u6709\u5fc5\u8981\u5bf9\u8fd9\u6b21\u9605\u8bfb\u7684\u5185\u5bb9\u8fdb\u884c\u6574\u7406\uff0c\u4e3a\u4ee5\u540e\u7684\u5de5\u4f5c\u505a\u51c6\u5907\u3002&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u7531\u4e8e\u6211\u5bf9\u8fd9\u4e2a\u82f1\u6587\u624b\u518c\u7684\u9605\u8bfb\u4e5f\u4ec5\u4ec5\u662f\u7ed3\u6784\u6027\u7684\u3002\u56e0\u6b64\u6709\u5f88\u591a\u5730\u65b9\u5e76\u6ca1\u6709\u770b\uff0c\u6240\u4ee5\u8fd9\u7bc7\u6587\u6863\u7684\u5185\u5bb9\u6211\u4e5f\u53ea\u80fd\u5199\u51fa\u90e8\u5206\uff0c\u5bf9\u4e8e\u4ee5\u540e\u9700\u8981\u8be6\u7ec6\u4e86\u89e3\u7684\u5730\u65b9\uff0c\u4f1a\u518d\u5f80\u8fd9\u7bc7\u6587\u6863\u4e2d\u589e\u6dfb\u5185\u5bb9\uff0c\u9700\u8981\u589e\u6dfb\u7684\u5185\u5bb9\u4e3b\u8981\u662f\u7f16\u8bd1\u5668\u7684\u5404\u79cd\u5f00\u5173\u3002&nbsp;<\/p>\n<p><\/p>\n<p>2. GCC\u529f\u80fd\u4ecb\u7ecd&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; GCC\u7f16\u8bd1\u5668\u5b8c\u6210\u4eceC\u3001C++\u3001objective-C\u7b49\u6e90\u6587\u4ef6\u5411\u8fd0\u884c\u5728\u7279\u5b9aCPU\u786c\u4ef6\u4e0a\u7684\u76ee\u6807\u4ee3\u7801\u7684\u8f6c\u6362\uff08\u8fd9\u662f\u4efb\u4f55\u4e00\u4e2a\u7f16\u8bd1\u5668\u9700\u8981\u5b8c\u6210\u7684\u4efb\u52a1\uff09\u3002&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; GCC\u80fd\u591f\u5904\u7406\u7684\u6e90\u6587\u4ef6\u5206\u4e3aC\u3001C++\u3001Objective-C\u3001\u6c47\u7f16\u8bed\u8a00\u7b49\u3002\u5bf9\u4e8e\u8fd9\u4e9b\u6e90\u6587\u4ef6\uff0c\u7528\u4ed6\u4eec\u7684\u540e\u7f00\u540d\u8fdb\u884c\u6807\u793a\u3002GCC\u80fd\u591f\u5904\u7406\u7684\u540e\u7f00\u6709\uff1a&nbsp;<\/p>\n<p><\/p>\n<p>a. *.c &nbsp;*.C &nbsp; &nbsp; &nbsp;(C\u8bed\u8a00)&nbsp;<\/p>\n<p><\/p>\n<p>b. *.cxx &nbsp; *.cc &nbsp;(C++\u8bed\u8a00)&nbsp;<\/p>\n<p><\/p>\n<p>c. *.m &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (\u9762\u5411\u5bf9\u8c61\u7684C)&nbsp;<\/p>\n<p><\/p>\n<p>d. *.i &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (\u9884\u5904\u7406\u540e\u7684C\u8bed\u8a00\u6e90\u6587\u4ef6)&nbsp;<\/p>\n<p><\/p>\n<p>e. *.ii &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(\u9884\u5904\u7406\u540e\u7684C++\u8bed\u8a00\u6e90\u6587\u4ef6)&nbsp;<\/p>\n<p><\/p>\n<p>f. *.s *.S &nbsp; &nbsp; &nbsp; (\u6c47\u7f16\u8bed\u8a00)&nbsp;<\/p>\n<p><\/p>\n<p>h. *.h &nbsp; &nbsp; &nbsp; &nbsp; (\u5934\u6587\u4ef6)&nbsp;<\/p>\n<p><\/p>\n<p>\u76ee\u6807\u6587\u4ef6\u53ef\u4ee5\u662f\uff1a&nbsp;<\/p>\n<p><\/p>\n<p>a. *.o &nbsp; &nbsp; \u7f16\u8bd1\u8fde\u63a5\u540e\u7684\u76ee\u6807\u6587\u4ef6&nbsp;<\/p>\n<p><\/p>\n<p>b. *.a &nbsp; &nbsp; \u5e93\u6587\u4ef6&nbsp;<\/p>\n<p><\/p>\n<p>\u7f16\u8bd1\u5668\u628a\u7f16\u8bd1\u751f\u6210\u76ee\u6807\u4ee3\u7801\u7684\u4efb\u52a1\u5206\u4e3a\u4ee5\u4e0b4\u6b65\uff1a&nbsp;<\/p>\n<p><\/p>\n<p>a.\u9884\u5904\u7406\uff0c\u628a\u9884\u5904\u7406\u547d\u4ee4\u626b\u63cf\u5904\u7406\u5b8c\u6bd5\uff1b&nbsp;<\/p>\n<p><\/p>\n<p>b.\u7f16\u8bd1\uff0c\u628a\u9884\u5904\u7406\u540e\u7684\u7ed3\u679c\u7f16\u8bd1\u6210\u6c47\u7f16\u6216\u8005\u76ee\u6807\u6a21\u5757\uff1b&nbsp;<\/p>\n<p><\/p>\n<p>c.\u6c47\u7f16\uff0c\u628a\u7f16\u8bd1\u51fa\u6765\u7684\u7ed3\u679c\u6c47\u7f16\u6210\u5177\u4f53CPU\u4e0a\u7684\u76ee\u6807\u4ee3\u7801\u6a21\u5757\uff1b&nbsp;<\/p>\n<p><\/p>\n<p>d.\u8fde\u63a5\uff0c\u628a\u591a\u4e2a\u76ee\u6807\u4ee3\u7801\u6a21\u5757\u8fde\u63a5\u751f\u6210\u4e00\u4e2a\u5927\u7684\u76ee\u6807\u6a21\u5757\uff1b&nbsp;<\/p>\n<p><\/p>\n<p>3. &nbsp;GCC\u5f00\u5173&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; GCC\u7684\u8fd0\u884c\u5f00\u5173\u5171\u5206\u4e3a11\u7c7b\uff0c\u8fd9\u662f\u7c7b\u5f00\u5173\u4ece11\u4e2a\u65b9\u9762\u63a7\u5236\u7740GCC\u7a0b\u5e8f\u7684\u8fd0\u884c\uff0c\u4ee5\u8fbe\u5230\u7279\u5b9a\u7684\u7f16\u8bd1\u76ee\u7684\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.1. &nbsp;\u5168\u5c40\u5f00\u5173(OVERALL OPTIONS)&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u5168\u5c40\u5f00\u5173\u7528\u6765\u63a7\u5236\u5728\u201cGCC\u529f\u80fd\u4ecb\u7ecd\u201d\u4e2d\u7684GCC\u76844\u4e2a\u6b65\u9aa4\u7684\u8fd0\u884c\uff0c\u5728\u7f3a\u7701\u7684\u60c5\u51b5\u4e0b\uff0c\u8fd94\u4e2a\u6b65\u9aa4\u90fd\u662f\u8981\u6267\u884c\u7684\uff0c\u4f46\u662f\u5f53\u7ed9\u5b9a\u4e00\u4e9b\u5168\u5c40\u5f00\u5173\u540e\uff0c\u8fd9\u4e9b\u6b65\u9aa4\u5c31\u4f1a\u5728\u67d0\u4e00\u6b65\u505c\u6b62\u6267\u884c\uff0c\u8fd9\u4ea7\u751f\u4e2d\u95f4\u7ed3\u679c\uff0c\u4f8b\u5982\u53ef\u80fd\u4f60\u53ea\u662f\u9700\u8981\u4e2d\u95f4\u751f\u6210\u7684\u9884\u5904\u7406\u7684\u7ed3\u679c\u6216\u8005\u662f\u6c47\u7f16\u6587\u4ef6(\u6bd4\u5982\u62df\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u770b\u67d0\u4e2aCPU\u4e0a\u7684\u6c47\u7f16\u8bed\u8a00\u600e\u4e48\u5199)\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.1.1. &nbsp;\u2013x &nbsp;language&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u5bf9\u4e8e\u6e90\u6587\u4ef6\u662f\u7528\u4ec0\u4e48\u8bed\u8a00\u7f16\u5199\u7684\uff0c\u53ef\u4ee5\u901a\u8fc7\u6587\u4ef6\u540d\u7684\u540e\u7f00\u6765\u6807\u793a\uff0c\u4e5f\u53ef\u4ee5\u7528\u8fd9\u5f00\u5173\u3002\u6307\u5b9a\u8f93\u5165\u6587\u4ef6\u662f\u4ec0\u4e48\u8bed\u8a00\u7f16\u5199\u7684\uff0clanguage \u53ef\u4ee5\u662f\u5982\u4e0b\u7684\u5185\u5bb9&nbsp;<\/p>\n<p><\/p>\n<p>a. &nbsp;c&nbsp;<\/p>\n<p><\/p>\n<p>b. objective-c&nbsp;<\/p>\n<p><\/p>\n<p>c. c-header&nbsp;<\/p>\n<p><\/p>\n<p>d. c++&nbsp;<\/p>\n<p><\/p>\n<p>e.cpp-output&nbsp;<\/p>\n<p><\/p>\n<p>f.assembler&nbsp;<\/p>\n<p><\/p>\n<p>g.assembler-with-cpp&nbsp;<\/p>\n<p><\/p>\n<p>3.1.2.\u2013x none&nbsp;<\/p>\n<p><\/p>\n<p>\u628a\u4e0a\u4e00\u8282\u4ecb\u7ecd\u7684-x\u5f00\u5173\u90fd\u7ed9\u5173\u6389\u4e86\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.1.3. &nbsp;\u2013c&nbsp;<\/p>\n<p><\/p>\n<p>\u7f16\u8bd1\u6210\u628a\u6e90\u6587\u4ef6\u76ee\u6807\u4ee3\u7801\uff0c\u4e0d\u505a\u8fde\u63a5\u7684\u52a8\u4f5c\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.1.4. \u2013S&nbsp;<\/p>\n<p><\/p>\n<p>\u628a\u6e90\u6587\u4ef6\u7f16\u8bd1\u6210\u6c47\u7f16\u4ee3\u7801\uff0c\u4e0d\u505a\u6c47\u7f16\u548c\u8fde\u63a5\u7684\u52a8\u4f5c\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.1.5. \u2013E&nbsp;<\/p>\n<p><\/p>\n<p>\u53ea\u628a\u6e90\u6587\u4ef6\u8fdb\u884c\u9884\u5904\u7406\u4e4b\u540e\u7684\u7ed3\u679c\u8f93\u51fa\u6765\u3002\u4e0d\u505a\u7f16\u8bd1\uff0c\u6c47\u7f16\uff0c\u8fde\u63a5\u7684\u52a8\u4f5c\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.1.6. &nbsp;\u2013o file&nbsp;<\/p>\n<p><\/p>\n<p>\u6307\u660e\u8f93\u51fa\u6587\u4ef6\u540d\u662ffile\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.1.7. \u2013v&nbsp;<\/p>\n<p><\/p>\n<p>\u628a\u6574\u4e2a\u7f16\u8bd1\u8fc7\u7a0b\u7684\u8f93\u51fa\u4fe1\u606f\u90fd\u7ed9\u6253\u5370\u51fa\u6765\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.1.8.\u2013pipe&nbsp;<\/p>\n<p><\/p>\n<p>\u7531\u4e8egcc\u7684\u5de5\u4f5c\u5206\u4e3a\u597d\u51e0\u6b65\u624d\u5b8c\u6210\uff0c\u6240\u4ee5\u9700\u8981\u5728\u8fc7\u7a0b\u4e2d\u751f\u6210\u4e34\u65f6\u6587\u4ef6\uff0c\u4f7f\u7528-pipe\u5c31\u662f\u7528\u7ba1\u9053\u66ff\u6362\u4e34\u65f6\u6587\u4ef6\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.2. &nbsp;\u8bed\u8a00\u76f8\u5173\u5f00\u5173(Language Options)&nbsp;<\/p>\n<p><\/p>\n<p>\u7528\u6765\u5904\u7406\u548c\u8bed\u8a00\u76f8\u5173\u7684\u63a7\u5236\u5f00\u5173\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.2.1.\u2013ansi&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u8fd9\u4e2a\u5f00\u5173\u8ba9GCC\u7f16\u8bd1\u5668\u628a\u6240\u6709\u7684gnu\u7684\u7f16\u8bd1\u5668\u7279\u6027\u90fd\u7ed9\u5173\u6389\uff0c\u8ba9\u4f60\u7684\u7a0b\u5e8f\u53ef\u4ee5\u548cansi\u6807\u51c6\u517c\u5bb9\u3002&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u9664\u4e86\u4ee5\u4e0a\u7684\u5f00\u5173\u5916\uff0c\u8bed\u8a00\u76f8\u5173\u5f00\u5173\u8fd8\u6709\u5f88\u591a\uff0c\u5982\u679c\u5728\u4ee5\u540e\u7684\u5de5\u4f5c\u5b66\u4e60\u4e2d\u9047\u5230\u4e86\u518d\u52a0\u4e0d\u8fdf\uff013.3.\u9884\u5904\u7406\u5f00\u5173(Preprocessor Options)&nbsp;<\/p>\n<p><\/p>\n<p>\u7528\u6765\u63a7\u5236\u9884\u5904\u7406\u6240\u8bbe\u7f6e\u7684\u5f00\u5173\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.3.1. \u2013include file&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u5728\u7f16\u8bd1\u4e4b\u524d\uff0c\u628afile\u5305\u542b\u8fdb\u53bb\uff0c\u76f8\u5f53\u4e8e\u5728\u6240\u6709\u7f16\u8bd1\u7684\u6e90\u6587\u4ef6\u6700\u524d\u9762\u52a0\u5165\u4e86\u4e00\u4e2a#include &lt;file&gt;\u8bed\u53e5\uff0c\u8fd9\u6837\u505a\u66f4\u201c\u7701\u6cb9\u201d\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.3.2. \u2013imacros file&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u540c-include file \u4e00\u6837\u3002\u4e0d\u8fc7\u8fd9\u4e2a\u6587\u4ef6\u5728\u5177\u4f53\u7f16\u8bd1\u7684\u65f6\u5019\u53ea\u6709\u91cc\u9762\u5b9a\u4e49\u7684\u5b8f\u624d\u8d77\u4f5c\u7528\uff0c\u6240\u4ee5\u503c\u7528\u6765\u5728file\u6587\u4ef6\u91cc\u9762\u5b9a\u4e49\u5b8f\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.3.3. \u2013nostdinc&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u5728\u641c\u5bfbinclude \u7684\u6587\u4ef6\u8def\u5f84\u4e2d\u53bb\u6389\u6807\u51c6\u7684c\u8bed\u8a00\u5934\u6587\u4ef6\u641c\u7d22\u8def\u5f84\uff0c\u4f8b\u5982stdio.h\u6587\u4ef6\u5c31\u662f\u653e\u5728\u6807\u51c6\u5934\u6587\u4ef6\u641c\u7d22\u8def\u5f84\u4e0b\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.3.4. &nbsp;\u2013nostdinc++&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u540c\u4e0a\uff0c\u53ea\u662f\u53bb\u6389\u7684\u662f\u6807\u51c6C++\u8bed\u8a00\u7684\u5934\u6587\u4ef6\u641c\u7d22\u8def\u5f84\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.3.5. \u2013C&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u540c-E\u53c2\u6570\u914d\u5408\u4f7f\u7528\u3002\u8ba9\u9884\u5904\u7406\u540e\u7684\u7ed3\u679c\uff0c\u628a\u6ce8\u91ca\u4fdd\u7559\uff0c\u8ba9\u4eba\u80fd\u591f\u6bd4\u8f83\u597d\u8bfb\u5b83\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.3.6. \u2013Dmacro&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u628amacro\u5b9a\u4e49\u4e3a\u5b57\u7b26\u4e32\u20191\u2019\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.3.7. \u2013Dmacro = defn&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u628amacro\u5b9a\u4e49\u4e3adefn\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.3.8. &nbsp;\u2013Umacro&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u628a\u5bf9macro\u7684\u5b9a\u4e49\u53d6\u6d88\u3002&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u9664\u4e86\u4ee5\u4e0a\u7684\u5f00\u5173\u5916\uff0c\u9884\u5904\u7406\u76f8\u5173\u5f00\u5173\u8fd8\u6709\u5f88\u591a\uff0c\u5982\u679c\u5728\u4ee5\u540e\u7684\u5de5\u4f5c\u5b66\u4e60\u4e2d\u9047\u5230\u4e86\u518d\u52a0\u4e0d\u8fdf\uff01&nbsp;<\/p>\n<p><\/p>\n<p>3.4. &nbsp; \u6c47\u7f16\u5f00\u5173(Assembler Option)&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u7528\u6765\u63a7\u5236\u6c47\u7f16\u884c\u4e3a\u7684\u5f00\u5173\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.4.1. &nbsp;\u2013Wa , option&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u628aoption\u4f5c\u4e3a\u5f00\u5173\u9001\u7ed9\u6c47\u7f16\u7a0b\u5e8f\u3002\u5982\u679coption\u91cc\u9762\u6709\u9017\u53f7\uff0c\u5219\u4f5c\u4e3a\u597d\u51e0\u884c\u8fdb\u884c\u5904\u7406\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.5.\u8fde\u63a5\u5f00\u5173(Linker Options)&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u7528\u6765\u63a7\u5236\u8fde\u63a5\u8fc7\u7a0b\u7684\u5f00\u5173\u9009\u9879\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.5.1. object-file-name&nbsp;<\/p>\n<p><\/p>\n<p>3.5.2. \u2013llibrary&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u8fde\u63a5\u5e93\u6587\u4ef6\u5f00\u5173\u3002\u4f8b\u5982-lugl\uff0c\u5219\u662f\u628a\u7a0b\u5e8f\u540clibugl.a\u6587\u4ef6\u8fdb\u884c\u8fde\u63a5\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.5.3. \u2013lobjc&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u8fd9\u4e2a\u5f00\u5173\u7528\u5728\u9762\u5411\u5bf9\u8c61\u7684C\u8bed\u8a00\u6587\u4ef6\u7684\u5e93\u6587\u4ef6\u5904\u7406\u4e2d\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.5.4. &nbsp;\u2013nostartfiles&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u5728\u8fde\u63a5\u7684\u65f6\u5019\u4e0d\u628a\u7cfb\u7edf\u76f8\u5173\u7684\u542f\u52a8\u4ee3\u7801\u8fde\u63a5\u8fdb\u6765\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.5.5. &nbsp; \u2013nostdlib&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u5728\u8fde\u63a5\u7684\u65f6\u5019\u4e0d\u628a\u7cfb\u7edf\u76f8\u5173\u7684\u542f\u52a8\u6587\u4ef6\u548c\u7cfb\u7edf\u76f8\u5173\u7684\u5e93\u8fde\u63a5\u8fdb\u6765\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.5.6. \u2013static&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u5728\u4e00\u4e9b\u7cfb\u7edf\u4e0a\u652f\u6301\u52a8\u6001\u8fde\u63a5\uff0c\u8fd9\u4e2a\u5f00\u5173\u5219\u4e0d\u5141\u8bb8\u52a8\u6001\u8fde\u63a5\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.5.7. \u2013shared&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u751f\u6210\u53ef\u5171\u4eab\u7684\u88ab\u5176\u4ed6\u7a0b\u5e8f\u8fde\u63a5\u7684\u76ee\u6807\u6a21\u5757\u3002&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u8fde\u63a5\u76f8\u5173\u7684\u5f00\u5173\u8fd8\u6709\u4e00\u4e9b\uff0c\u4ee5\u540e\u9700\u8981\u7684\u65f6\u5019\u518d\u8865\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.6.\u76ee\u5f55\u76f8\u5173\u5f00\u5173(Directory Options)&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u7528\u4e8e\u5b9a\u4e49\u4e0e\u76ee\u5f55\u64cd\u4f5c\u76f8\u5173\u7684\u5f00\u5173\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.6.1. \u2013Idir&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u5b8finclude\u9700\u8981\u641c\u5bfb\u7684\u76ee\u5f55\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.6.2.\u2013I-&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u4e0e-I\u5f00\u5173\u7c7b\u4f3c\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.6.3.\u2013Ldir&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u641c\u5bfb\u5e93\u6587\u4ef6(*.a)\u7684\u8def\u5f84\u3002&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u548c\u76ee\u5f55\u76f8\u5173\u7684\u5f00\u5173\u8fd8\u6709\u5f88\u591a\uff0c\u4ee5\u540e\u9700\u8981\u518d\u52a0\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.7. \u8b66\u544a\u5f00\u5173(Warning Options)&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u4e0e\u8b66\u544a\u5904\u7406\u76f8\u5173\u7684\u5f00\u5173\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.7.1.\u2013fsyntax-only&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u53ea\u68c0\u67e5\u4ee3\u7801\u4e2d\u7684\u8bed\u6cd5\u9519\u8bef\uff0c\u4f46\u5e76\u6ca1\u6709\u8f93\u51fa\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.7.2. \u2013w&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u7981\u6b62\u4e00\u5207\u8b66\u544a\u4fe1\u606f\u6253\u5370\u51fa\u6765\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.7.3. \u2013Wno-import&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u7981\u6b62\u5bf9\u5b8f#import\u63d0\u51fa\u8b66\u544a\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.7.4. \u2013pedantic&nbsp;<\/p>\n<p><\/p>\n<p>3.7.5. &nbsp;\u2013pedantic-errors&nbsp;<\/p>\n<p><\/p>\n<p>3.7.6. &nbsp;\u2013W&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp;\u8fd8\u6709\u5f88\u591a\u4e0e\u8b66\u544a\u5904\u7406\u76f8\u5173\u7684\u5f00\u5173\uff0c\u4ee5\u540e\u518d\u8865\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.8. \u8c03\u8bd5\u5f00\u5173(Debugging Options)&nbsp;<\/p>\n<p><\/p>\n<p>3.8.1.\u2013g&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u628a\u8c03\u8bd5\u5f00\u5173\u6253\u5f00\uff0c\u8ba9\u7f16\u8bd1\u7684\u76ee\u6807\u6587\u4ef6\u6709\u8c03\u8bd5\u4fe1\u606f\u3002&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u8fd8\u6709\u5f88\u591a\u4e0e\u8c03\u8bd5\u5904\u7406\u76f8\u5173\u7684\u5f00\u5173\uff0c\u4ee5\u540e\u518d\u8865\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.9. \u4f18\u5316\u5f00\u5173(Optimization Options)&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; -O1 \u2013O2 \u2013O3 \u2013O0\uff0c\u8fd9\u4e9b\u5f00\u5173\u5206\u522b\u63a7\u5236\u4f18\u5316\u7684\u5f3a\u5ea6\uff0c-O3\u6700\u5f3a\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.10. \u76ee\u6807\u673a\u5f00\u5173(Target Options)&nbsp;<\/p>\n<p><\/p>\n<p>3.10.1. \u2013b machine&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u5728\u6709\u7684\u65f6\u5019\uff0cGcc\u7f16\u8bd1\u5668\u7f16\u8bd1\u51fa\u6765\u7684\u76ee\u6807\u4ee3\u7801\u5e76\u4e0d\u662f\u5728\u8fd0\u884c\u8fd9\u4e2a\u7f16\u8bd1\u52a8\u4f5c\u7684\u673a\u5668\u4e0a\u8fd0\u884c\u800c\u662f\u53e6\u5916\u4e00\u53f0\u673a\u5668\uff0c\u8fd9\u79cd\u7f16\u8bd1\u53eb\u505a\u4ea4\u53c9\u7f16\u8bd1\uff0c\u7528\u6765\u8fd0\u884c\u6700\u7ec8\u76ee\u6807\u4ee3\u7801\u7684\u5f97\u673a\u5668\u53eb\u505a\u76ee\u6807\u673a\uff0cmachine\u5c31\u662f\u7528\u6765\u6307\u660e\u76ee\u6807\u673a\u7684\u7c7b\u578b\u7684\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.10.2. &nbsp;\u2013V version&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u7528\u6765\u544a\u8bc9\u7f16\u8bd1\u5668\u4f7f\u7528\u5b83\u7684\u591a\u5c11\u7248\u672c\u7684\u529f\u80fd\uff0cversion\u53c2\u6570\u7528\u6765\u8868\u793a\u7248\u672c\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.11. &nbsp; CPU\u76f8\u5173\u5f00\u5173(Machine Dependent Options)&nbsp;<\/p>\n<p><\/p>\n<p>&nbsp; &nbsp; \u6bd4\u8f83\u591a\uff0c\u4e5f\u662f\u5728\u4ea4\u53c9\u7f16\u8bd1\u7684\u65f6\u5019\u7528\u5f97\u7740\u3002\u4ee5\u540e\u518d\u8bf4\u3002&nbsp;<\/p>\n<p><\/p>\n<p>3.12. \u751f\u6210\u4ee3\u7801\u5f00\u5173(Code Generation Options)&nbsp;<\/p>\n<p><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1.\u524d\u8a00&nbsp; &nbsp; &nbsp; GCC\u7f16\u8bd1\u5668\u7684\u624b\u518c(GCC MANUAL)\u7684\u82f1\u6587\u7248\u5df2\u7ecf\u975e\u5e38\u5168 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-15606","post","type-post","status-publish","format-standard","hentry","category-default"],"_links":{"self":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts\/15606"}],"collection":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15606"}],"version-history":[{"count":0,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts\/15606\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}