{"id":1243,"date":"2023-02-26T08:25:34","date_gmt":"2023-02-26T08:25:34","guid":{"rendered":"https:\/\/262235.xyz\/?p=1243"},"modified":"2023-02-26T08:25:34","modified_gmt":"2023-02-26T08:25:34","slug":"1243","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2023\/02\/26\/1243\/","title":{"rendered":"VS Code\u548cTDM Gcc \u4f7f\u7528 Makefile \u7f16\u8bd1\u5b66\u4e60 Windows \u7a0b\u5e8f\u8bbe\u8ba1"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2023\/02\/1376616376.png\" alt=\"vscode_gcc.png\" title=\"vscode_gcc.png\"><\/p>\n<h2>\u4f7f\u7528 <code>C\/C++ Makefile Project<\/code> \u63d2\u4ef6\u5efa\u7acb Makefile<\/h2>\n<ul>\n<li><code>ctrl+shift+p<\/code>, \u63d2\u4ef6\u9009\u62e9 Only C++ Makefile<\/li>\n<\/ul>\n<h2>\u4fee\u6539\u8fc7\u7684 <code>Makefile<\/code> \u6dfb\u52a0\u4e86 <code>windres.exe<\/code> \u7f16\u8bd1 <code>resource.rc<\/code><\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2023\/02\/310870745.png\" alt=\"Makefile.png\" title=\"Makefile.png\"><\/p>\n<h2>Makefile<\/h2>\n<pre><code># Compiler settings - Can be customized.\nCC = g++\nWINDRES = windres.exe\nCXXFLAGS = -Wall -O2 -std=c++11 -fexec-charset=gbk -finput-charset=UTF-8\nLDFLAGS =  -s -shared-libstdc++  -lgdi32 -luser32 -lkernel32 -lcomctl32 -mwindows\n\n# Makefile settings - Can be customized.\nAPPNAME = WinKcp_Launcher\nEXT = .cpp\n\nSRCDIR = .\nOBJDIR = .\n\n############## Do not change anything from here downwards! #############\nSRC = $(wildcard $(SRCDIR)\/*$(EXT))\nOBJ = $(SRC:$(SRCDIR)\/%$(EXT)=$(OBJDIR)\/%.o)\nDEP = $(OBJ:$(OBJDIR)\/%.o=%.d)\n\n####################### Targets beginning here #########################\nall: $(APPNAME)\n\n# Builds the app\n$(APPNAME): $(OBJ)\n    $(WINDRES)  -J rc -O coff -i resource.rc -o resource.res\n    $(CC) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)  resource.res\n\n# Includes all .h files\n-include $(DEP)\n\n# Building rule for .o files and its .c\/.cpp in combination with all .h\n$(OBJDIR)\/%.o: $(SRCDIR)\/%$(EXT)\n    $(CC)  $(CXXFLAGS) -o $@ -c $&lt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 C\/C++ Makefile Project \u63d2\u4ef6\u5efa\u7acb Makefile ctrl+shift [&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-1243","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\/1243","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=1243"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1243\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1243"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1243"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}