{"id":897,"date":"2022-01-17T08:12:00","date_gmt":"2022-01-17T08:12:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=897"},"modified":"2022-01-17T08:12:00","modified_gmt":"2022-01-17T08:12:00","slug":"897","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2022\/01\/17\/897\/","title":{"rendered":"VS Code \u4f7f\u7528 C\/C++ Makefile Project \u63d2\u4ef6\u5efa\u7acb\u9879\u76ee"},"content":{"rendered":"<h3>1.\u641c\u7d22 <code>C\/C++ Makefile<\/code> \u5b89\u88c5\u63d2\u4ef6<\/h3>\n<ul>\n<li>\u5b89\u88c5 C\/C++ Makefile Project \u63d2\u4ef6\u540e\uff0c\u6309\u63d0\u793a\u4f7f\u7528<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/01\/3539573741.png\" alt=\"Makefile.png\" title=\"Makefile.png\"><\/p>\n<h3>2.\u8c03\u7528\u63d2\u4ef6\u521d\u59cb\u5316 <code>Makefie<\/code> \u6587\u4ef6<\/h3>\n<ul>\n<li><code>Ctrl+Shift+P<\/code> \u5feb\u6377\u952e\u6253\u5f00\u9762\u677f\uff0c\u8f93\u5165<code>INIT Project<\/code> \u8c03\u7528\u63d2\u4ef6\uff0c\u4f1a\u5efa\u7acb\u4e00\u4e2a\u6a21\u7248<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/01\/3071716227.png\" alt=\"src.png\" title=\"src.png\"><\/p>\n<h3>3.Windows\u4f7f\u7528TDM-GCC\u7f16\u8bd1\u5668\uff0c\u4f7f\u7528 <code>mingw32-make.exe<\/code> \u8c03\u7528 <code>Makefile<\/code> \u7f16\u8bd1<\/h3>\n<ul>\n<li>\n<p>tdm-gcc \u9ed8\u8ba4\u6ca1\u6709 make.exe, \u627e\u5230 mingw32-make.exe \u590d\u5236\u4e00\u4e2a\u6539\u540d\u6210 make.exe \u4e5f\u884c<br \/><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2022\/01\/1673842192.png\" alt=\"make.png\" title=\"make.png\"><\/p>\n<pre><code>$ mingw32-make.exe\ngcc -std=c11 -Wall -o obj\/b.o -c src\/b.c\ngcc -std=c11 -Wall -o obj\/a.o -c src\/a.c\ngcc -std=c11 -Wall -o myapp obj\/b.o obj\/a.o\n\n$ .myapp.exe\nTest_Makefileint add(int a, int b);\na + b = 187<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>4.<code>Makefie<\/code> \u6587\u4ef6\u7ba1\u7406\u591a\u6587\u4ef6\u7f16\u8bd1\uff0c\u6587\u4ef6\u548c\u76ee\u5f55\u5c42\u6b21<\/h3>\n<pre><code>$ tree \/F\n\nPath\n\u2502  Makefile\n\u2502  a.d\n\u2502  b.d\n\u2502  myapp.exe\n\u251c\u2500src\n\u2502  \u2502  a.c\n\u2502  \u2502  b.h\n\u2502  \u2502  b.c\n\u2502  \u2514\u2500include\n\u2514\u2500obj\n        b.o\n        a.o<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1.\u641c\u7d22 C\/C++ Makefile \u5b89\u88c5\u63d2\u4ef6 \u5b89\u88c5 C\/C++ Makefile Project [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[31,50],"class_list":["post-897","post","type-post","status-publish","format-standard","hentry","category-learn","tag-cpp","tag-vscode"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=897"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/897\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}