{"id":125544,"date":"2020-06-23T05:35:33","date_gmt":"2020-06-22T21:35:33","guid":{"rendered":"http:\/\/4563.org\/?p=125544"},"modified":"2020-06-23T05:35:33","modified_gmt":"2020-06-22T21:35:33","slug":"makefile-%e5%91%bd%e4%bb%a4%e4%b8%ad%e8%83%bd%e4%bd%bf%e7%94%a8-gcc%ef%bc%8c%e4%b8%8d%e8%83%bd%e7%94%a8-cc%ef%bc%88windows-%e4%b8%ad%ef%bc%89","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=125544","title":{"rendered":"Makefile \u547d\u4ee4\u4e2d\u80fd\u4f7f\u7528 gcc\uff0c\u4e0d\u80fd\u7528 cc\uff08Windows \u4e2d\uff09"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Makefile \u547d\u4ee4\u4e2d\u80fd\u4f7f\u7528 gcc\uff0c\u4e0d\u80fd\u7528 cc\uff08Windows \u4e2d\uff09               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Deteriorator <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>main.o: main.c  gcc -g -c main.c  \u8fd9\u6761\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c <\/code><\/pre>\n<p>\u6211\u662f\u5728 Windows \u7cfb\u7edf\u4e2d\u7528\u7684\uff0c\u547d\u4ee4\u90e8\u5206\u4f7f\u7528 gcc \u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\uff0c\u4f46\u662f\u4f7f\u7528 cc \u5c31\u4f1a\u51fa\u73b0\u4e0b\u9762\u7684\u8fd9\u79cd\u9519\u8bef\uff0c\u9ebb\u70e6\u5de8\u4f6c\u89e3\u7b54\u4e00\u4e0b\u4ee5\u540e\u6362\u6210 Linux \u540e\u8fd9\u4e2a Makefile \u8fd8\u80fd\u7528\u5417<\/p>\n<pre><code>main.o: main.c  cc -g -c main.c  \u9519\u8bef\u4fe1\u606f\uff1a process_begin: CreateProcess(NULL, cc -g -c main.c, ...) failed. make (e=2): \u7cfb\u7edf\u627e\u4e0d\u5230\u6307\u5b9a\u7684\u6587\u4ef6\u3002 make: *** [D:\/Projects\/Book\/Modern.Compiler.Implementation.in.C\/chap1\/Makefile:8 : main.o] Error 2 <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2153290\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : vk42 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u63d0\u793a\u4e0d\u662f\u8bf4\u4e86\u627e\u4e0d\u5230 cc \u4e48                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2153291\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Mingw \u6ca1\u7ed9 cc \u505a\u7b26\u53f7\u94fe\u63a5\uff08                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2153292\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u8fc7 0202 \u5e74\u4e86\uff0c\u5e94\u8be5\u7528 cmake \u4e00\u7c7b\u7684 makefile generator \u505a\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2153293\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Deteriorator <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @codehz \u591a\u8c22\uff0c\u73b0\u5728\u5728\u770b\u4e66\uff0c\u5148\u6309\u7167\u4e66\u4e0a\u7684\u8d70\u4e00\u4e0b\uff0ccmake \u4e5f\u5728\u5b66                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2153294\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hatsuyuki <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             cc \u5728 Linux \u91cc\u662f\u6307\u5411 gcc \u7684\u7b26\u53f7\u94fe\u63a5\uff0c\u4f60\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a gcc \u7684\u526f\u672c\u6539\u540d\u4e3a cc\uff0c\u6216\u8005\u4fee\u6539 Makefile \u6587\u4ef6<br \/>&#8220;`<br \/>main.o: main.c<br \/> $(cc) -g -c main.c<br \/>&#8220;`                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2153295\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hatsuyuki <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6f0f\u4e86\u4e00\u53e5\uff0c\u8981\u5148\u5b9a\u4e49 cc = gcc\uff0c\u624d\u80fd\u4f7f\u7528 $(cc)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2153296\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Deteriorator <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @hatsuyuki \u8c22\u8c22                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2153297\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : CBS <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u4e4b\u524d\u4e5f\u51fa\u73b0\u4e86\u8fd9\u4e2a\u95ee\u9898\u2026<\/p>\n<p>\u4e0d\u8fc7\u73b0\u5728\u7528 CMake \u4e86                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2153298\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : waruqi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e5f\u53ef\u4ee5\u7528 xmake \u7b80\u5355\u7701\u4e8b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Makefile \u547d\u4ee4\u4e2d\u80fd\u4f7f\u7528 g&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/125544"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=125544"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/125544\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=125544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=125544"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=125544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}