{"id":19979,"date":"2024-03-28T15:42:11","date_gmt":"2024-03-28T07:42:11","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=19979"},"modified":"2024-03-28T15:42:11","modified_gmt":"2024-03-28T07:42:11","slug":"windows%e5%b0%86obj%e6%96%87%e4%bb%b6%e7%94%9f%e6%88%90exe%e6%96%87%e4%bb%b6%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/19979\/","title":{"rendered":"windows\u5c06obj\u6587\u4ef6\u751f\u6210exe\u6587\u4ef6\u4ecb\u7ecd"},"content":{"rendered":"

\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u4f7f\u7528\u7f16\u7a0b\u8bed\u8a00\u7f16\u5199\u7a0b\u5e8f\uff0c\u7136\u540e\u5c06\u7a0b\u5e8f\u7f16\u8bd1\u6210\u53ef\u6267\u884c\u6587\u4ef6\uff08exe\u6587\u4ef6\uff09\u4ee5\u4fbf\u7528\u6237\u8fd0\u884c\u3002\u5728\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\uff0c\u7f16\u8bd1\u5668\u5c06\u6e90\u4ee3\u7801\u8f6c\u6362\u4e3a\u673a\u5668\u8bed\u8a00\uff0c\u5e76\u5c06\u5176\u6253\u5305\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u3002\u4f46\u662f\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u624b\u52a8\u5c06obj\u6587\u4ef6\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u3002\u672c\u6587\u5c06\u4ecb\u7ecdWindows\u5c06obj\u6587\u4ef6<\/p>\n

<\/figure>\n<\/p>\n

\u751f\u6210exe\u6587\u4ef6\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n

\u539f\u7406<\/p>\n

\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0cobj\u6587\u4ef6\u662f\u7f16\u8bd1\u5668\u751f\u6210\u7684\u4e2d\u95f4\u6587\u4ef6\u3002\u5b83\u5305\u542b\u7a0b\u5e8f\u7684\u4e8c\u8fdb\u5236\u4ee3\u7801\uff0c\u4f46\u4e0d\u5305\u542b\u7a0b\u5e8f\u5165\u53e3\u70b9\u548c\u5176\u4ed6\u5fc5\u8981\u7684\u4fe1\u606f\uff08\u4f8b\u5982\u7a0b\u5e8f\u5165\u53e3\u5730\u5740\u548c\u5e93\u51fd\u6570\u5f15\u7528\uff09\u3002\u56e0\u6b64\uff0c\u5c06obj\u6587\u4ef6\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u9700\u8981\u5c06\u8fd9\u4e9b\u4fe1\u606f\u6dfb\u52a0\u5230\u6587\u4ef6\u4e2d\u3002<\/p>\n

\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0cexe\u6587\u4ef6\u5305\u542b\u4ee5\u4e0b\u90e8\u5206\uff1a<\/p>\n

1. DOS\u5934\uff1a\u8fd9\u4e2a\u5934\u90e8\u5305\u542b\u4e86DOS\u7a0b\u5e8f\u7684\u5165\u53e3\u70b9\u548c\u5176\u4ed6\u4fe1\u606f\u3002<\/p>\n

2. PE\u5934\uff1a\u8fd9\u4e2a\u5934\u90e8\u5305\u542b\u4e86PE\u7a0b\u5e8f\u7684\u5165\u53e3\u70b9\u548c\u5176\u4ed6\u4fe1\u606f\u3002<\/p>\n

3. \u8282\u533a\uff1a\u8fd9\u4e9b\u8282\u533a\u5305\u542b\u7a0b\u5e8f\u7684\u4ee3\u7801\u3001\u6570\u636e\u548c\u5176\u4ed6\u8d44\u6e90\u3002<\/p>\n

\u56e0\u6b64\uff0c\u5c06obj\u6587\u4ef6\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u9700\u8981\u5c06obj\u6587\u4ef6\u7684\u4e8c\u8fdb\u5236\u4ee3\u7801\u6dfb\u52a0\u5230\u8282\u533a\u4e2d\uff0c\u5e76\u5c06\u7a0b\u5e8f\u5165\u53e3\u70b9\u548c\u5176\u4ed6\u4fe1\u606f\u6dfb\u52a0\u5230PE\u5934\u4e2d\u3002<\/p>\n

\u8be6\u7ec6\u6b65\u9aa4<\/p>\n

\u4e0b\u9762\u662f\u5c06obj\u6587\u4ef6\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n

1. \u6253\u5f00Visual Studio\u547d\u4ee4\u63d0\u793a\u7b26\u3002\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0cVisual Studio\u547d\u4ee4\u63d0\u793a\u7b26\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06obj\u6587\u4ef6\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u3002\u60a8\u53ef\u4ee5\u5728\u5f00\u59cb\u83dc\u5355\u4e2d\u641c\u7d22Visual Studio\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u7136\u540e\u5355\u51fb\u6253\u5f00\u5b83\u3002<\/p>\n

2. \u4f7f\u7528link\u547d\u4ee4\u5c06obj\u6587\u4ef6\u94fe\u63a5\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u3002\u5728Visual Studio\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

link \/S\u5f00\u53d1\u7535\u8111\u7aefpc\u5e94\u7528<\/a>UBSYSTEM:CONSOLE \/ENTRY:main objfile.obj<\/p>\n

\u5176\u4e2d\uff0c\/SUBSYSTEM:CONSOLE\u6307\u5b9a\u7a0b\u5e8f\u7684\u5b50\u7cfb\u7edf\u4e3a\u63a7\u5236\u53f0\u5e94\u7528\u7a0b\u5e8f\uff0c\/ENTRY:main\u6307\u5b9a\u7a0b\u5e8f\u7684\u5165\u53e3\u70b9\u4e3amain\u51fd\u6570\u3002<\/p>\n

3. \u6307\u5b9a\u8f93\u51fa\u6587\u4ef6\u540d\u548c\u8def\u5f84\u3002\u5728li\u7535\u8111\u5e94\u7528\u8f6f\u4ef6\u5236\u4f5c<\/a>nk\u547d\u4ee4\u4e2d\uff0c\u4f7f\u7528\/out\u9009\u9879\u6307\u5b9a\u8f93\u51fa\u6587\u4ef6\u540d\u548c\u8def\u5f84\u3002\u4f8b\u5982\uff0c\u4ee5\u4e0b\u547d\u4ee4\u5c06obj\u6587\u4ef6\u94fe\u63a5\u5230\u540d\u4e3a\u201cprogram.exe\u201d\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff1a<\/p>\n

link \/SUBSYSTEM:CONSOLE \/ENTRY:main objfile.obj \/out:program.exe<\/p>\n

4. \u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5728\u94fe\u63a5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6\u6765\u8fd0\u884c\u7a0b\u5e8f\u3002<\/p>\n

\u603b\u7ed3<\/p>\n

\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u5c06obj\u6587\u4ef6\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u9700\u8981\u5c06obj\u6587\u4ef6\u7684\u4e8c\u8fdb\u5236\u4ee3\u7801\u6dfb\u52a0\u5230\u8282\u533a\u4e2d\uff0c\u5e76\u5c06\u7a0b\u5e8f\u5165\u53e3\u70b9\u548c\u5176\u4ed6\u4fe1\u606f\u6dfb\u52a0\u5230PE\u5934\u4e2d\u3002\u4f7f\u7528Visual Studio\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u7684link\u547d\u4ee4\uff0c\u53ef\u4ee5\u5c06obj\u6587\u4ef6\u94fe\u63a5\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u5e76\u6307\u5b9a\u8f93\u51fa\u6587\u4ef6\u540d\u548c\u8def\u5f84\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u4f7f\u7528\u7f16\u7a0b\u8bed\u8a00\u7f16\u5199\u7a0b\u5e8f\uff0c\u7136\u540e\u5c06\u7a0b\u5e8f\u7f16\u8bd1\u6210\u53ef\u6267\u884c\u6587\u4ef6\uff08exe\u6587\u4ef6\uff09\u4ee5\u4fbf\u7528\u6237\u8fd0\u884c\u3002\u5728\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\uff0c\u7f16\u8bd1\u5668\u5c06\u6e90\u4ee3\u7801\u8f6c\u6362\u4e3a\u673a\u5668\u8bed\u8a00\uff0c\u5e76\u5c06\u5176\u6253\u5305\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u3002\u4f46\u662f\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[22287,22286,16,89,300],"topic":[],"class_list":["post-19979","post","type-post","status-publish","format-standard","hentry","category-exekf","tag-linuxetag","tag-22286","tag-16","tag-89","tag-300"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/19979","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=19979"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/19979\/revisions"}],"predecessor-version":[{"id":20066,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/19979\/revisions\/20066"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=19979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=19979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=19979"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=19979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}