{"id":1404,"date":"2023-08-01T22:09:55","date_gmt":"2023-08-01T14:09:55","guid":{"rendered":"https:\/\/lyvba.com\/?p=1404"},"modified":"2023-08-01T22:09:55","modified_gmt":"2023-08-01T14:09:55","slug":"zerobase-learn-cpp-04","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2023\/08\/01\/zerobase-learn-cpp-04\/","title":{"rendered":"VSCode \u914d\u7f6e CodeRunner \u7f16\u8bd1 C++\u5b66\u4e60\u7f16\u7a0b\u57fa\u7840"},"content":{"rendered":"<h3>\u53d1\u4e2a\u5c0f\u5de7\u7684 MSVC\u7f16\u8bd1\u5668 MSVC_2010_SP1_x86.7z \u89e3\u51b3 WIn7 Dll \u9000\u51fa\u9519\u8bef\u62a5\u544a\u95ee\u9898<\/h3>\n<p>MSVC_2010_SP1_x86.7z   \u5360\u7528\u7a7a\u95f4  26.6 MB (27,975,680 \u5b57\u8282)<br \/>\n\u4e0b\u8f7d\u5730\u5740   <a href=\"https:\/\/wwcz.lanzout.com\/iTX6k1435fba\">https:\/\/wwcz.lanzout.com\/iTX6k1435fba<\/a><\/p>\n<p>\u5efa\u7acb\u4e00\u4e2a\u76ee\u5f55  C:\\CodeBlocks\\MSVC  \u6307\u5b9a\u4e00\u4e0b NTFS \u6587\u4ef6\u538b\u7f29 \u5305\u542b\u5b50\u76ee\u5f55<br \/>\n\u5927\u5c0f 311 MB (326,424,277 \u5b57\u8282)<br \/>\n\u5360\u7528\u7a7a\u95f4 141 MB (148,896,749 \u5b57\u8282)<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2023\/08\/VSCode_Runner.gif\" alt=\"\" \/><\/p>\n<h3>VS Code \u914d\u7f6e CodeRunner \u7f16\u8bd1 C++ \u6587\u4ef6\u52a8\u753b\u6f14\u793a<\/h3>\n<ol>\n<li>\u5b89\u88c5\u63d2\u4ef6 CodeRunner \u5148 \u70b9\u51fb\u53f3\u4e0b\u89d2 c++\u6587\u5b57\uff0c\u4e0a\u9762\u4e0b\u62c9\u83dc\u5355\u9009\u62e9 C++ \u8bed\u8a00\u57fa\u7840\u8bbe\u7f6e<\/li>\n<\/ol>\n<p>&quot;cpp&quot;: &quot;cd $dir &amp;&amp; cl.exe \/nologo \/w \/EHsc \/Ox \/DNDEBUG \/MD $fileName  \/link rpcrt4.lib msvcrt.lib msvcprt.lib Gdi32.lib user32.lib Kernel32.lib  &amp;&amp; $dir$fileNameWithoutExt&quot;,<\/p>\n<ol start=\"2\">\n<li>\u6309\u56fe\u793a\u586b\u5165\u4e0b\u9762\u6d4b\u8bd5\u4ee3\u7801\u4e2d\u6ce8\u91ca\u7684\u54ea\u884c\uff0c\u4fee\u6539\u5230 josn \u914d\u7f6e\u6587\u4ef6\u4e2d<\/li>\n<\/ol>\n<pre><code>#include &lt;windows.h&gt;\n#include &lt;stdio.h&gt;\n#pragma rpcrt4.lib\nint main()\n{\n    UUID uuid;\n    UuidCreate(&amp;uuid);  \n\n    char *uuid_str;\n    UuidToStringA(&amp;uuid, (RPC_CSTR*)&amp;uuid_str);   \/\/ \u4e3a UUID \u5b57\u7b26\u4e32\u5206\u914d\u52a8\u6001\u5185\u5b58\n    printf(&quot;UUID: %s\\n&quot;, uuid_str);\n    RpcStringFreeA((RPC_CSTR*)&amp;uuid_str);         \/\/ \u91ca\u653e UUID \u5b57\u7b26\u4e32\u52a8\u6001\u5185\u5b58\n    return 0;\n}\n\/\/   &quot;cpp&quot;: &quot;cd $dir &amp;&amp; cl.exe \/nologo \/w \/EHsc  \/Ox \/DNDEBUG \/MD $fileName  \/link rpcrt4.lib  msvcrt.lib msvcprt.lib Gdi32.lib user32.lib Kernel32.lib  &amp;&amp; $dir$fileNameWithoutExt&quot;,<\/code><\/pre>\n<hr \/>\n<p>\u4e00\u822c\u5b66\u4e60 C\/C++ \u57fa\u7840\u8bed\u6cd5\u4e0d\u5b66GUI\uff0c\u4f7f\u7528\u8fd9\u4e2a \u7f16\u8bd1\u5668\u4e00\u822c\u591f\u7528\u4e86\u3002\u800c\u4e14\u7f16\u8bd1\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u517c\u5bb9\u6027\u597d\uff0c\u5f88\u5c11\u63d0\u793a\u7f3a\u5c11\u5176\u4ed6dll\u5e93<\/p>\n<pre><code>INCLUDE=C:\\CodeBlocks\\MSVC\\include\nLIB=C:\\CodeBlocks\\MSVC\\lib\nPATH \u589e\u52a0   C:\\CodeBlocks\\MSVC\\bin<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2023\/08\/lib.png\" alt=\"\" \/><\/p>\n<p>\u4e00\u822c\u914d\u5408 CodeBlocks \u4f7f\u7528\uff0c\u5982\u679c\u60f3\u7ed9 VSCode \u6216\u8005 \u547d\u4ee4\u884c\u4f7f\u7528\uff0c\u9700\u8981\u624b\u5de5\u6dfb\u52a0\u73af\u5883\u53d8\u91cf<br \/>\n\u5982\u4e0a\u56fe\uff0c\u6dfb\u52a0 INCLUDE   LIB  \u548c PATH<\/p>\n<pre><code>cl.exe \/nologo a.c ;  .\\a.exe<\/code><\/pre>\n<p>\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u884c \u7f16\u8bd1\u548c\u8fd0\u884c c \u6e90\u7801\u548c\u7a0b\u5e8f<\/p>\n<p>\u81ea\u5df1\u4f7f\u7528 C++ \u5199\u4e86 DLL \u7ed9 VBA \u7a0b\u5e8f\u8c03\u7528\u3002 \u5728\u4e00\u53f0\u5de5\u4f5c\u7535\u8111\u4e0a \u4f7f\u7528\u8fd8\u7b97\u6b63\u5e38\uff0c\u4f46\u662f\u5173\u95ed\u7a0b\u5e8f\u7684\u65f6\u5019\u4f1a\u8df3\u9519\u8bef\u62a5\u544a\u3002<\/p>\n<p>\u7f16\u8bd1\u7684 DLL \u4f7f\u7528 TDM-GCC \u7f16\u8bd1\u7684\uff0c\u53ef\u80fd\u5bf9 win7 \u652f\u6301\u4e0d\u592a\u597d\uff0c\u5728\u5176\u4ed6 WIN 10 win11 \u4e0d\u4f1a\u8df3\u9519\u8bef\u3002\u5728 win7 \u7684 CorelDRAW 2020\u4e0b\u53c8\u4e0d\u4f1a\u8df3\u62a5\u544a\u3002<br \/>\n\u6298\u817e\u4e86\u5f88\u957f\u65f6\u95f4\u672a\u679c\u3002<br \/>\n\u540e\u6765 \u4f7f\u7528\u8fd9\u4e2a MSVC 2010 \u7f16\u8bd1\u5668 \u7f16\u8bd1 32 \u4f4d\u7684 dll , \u4f7f\u7528\u540e\u5c31 \u4e0d\u4f1a\u8df3\u9519\u8bef\u62a5\u544a\u4e86\u3002<\/p>\n<p>64\u4f4ddll  \u8fd8\u6ca1\u627e\u5230\u5408\u9002\u7684\u7f16\u8bd1\u5668 \uff0c\u7f51\u4e0a\u627e\u5230\u4e00\u4e2a\u4fee\u6539\u6ce8\u518c\u8868\uff0c\u8ba9\u4ed6\u9519\u8bef\u62a5\u544a\u4e0d\u63d0\u793a\u4e86\u3002<br \/>\n\u4fee\u6539  DontShowUI \u7684\u503c\uff0c\u6539\u6210 0<\/p>\n<pre><code>Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Windows Error Reporting]\n&quot;DontShowUI&quot;=dword:00000001\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u53d1\u4e2a\u5c0f\u5de7\u7684 MSVC\u7f16\u8bd1\u5668 MSVC_2010_SP1_x86.7z \u89e3\u51b3 WIn7 Dll \u9000\u51fa\u9519 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1380,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[31,50],"class_list":["post-1404","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","tag-cpp","tag-vscode"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1404","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=1404"}],"version-history":[{"count":1,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1404\/revisions"}],"predecessor-version":[{"id":1407,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/1404\/revisions\/1407"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media\/1380"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=1404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=1404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=1404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}