{"id":2065,"date":"2020-07-08T12:02:13","date_gmt":"2020-07-08T04:02:13","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=2065"},"modified":"2020-12-17T21:32:56","modified_gmt":"2020-12-17T13:32:56","slug":"luajit%e7%bc%96%e8%af%91","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=2065","title":{"rendered":"Luajit\u7f16\u8bd1"},"content":{"rendered":"\n<p>1\u3001\u4e0b\u8f7d<br> <a href=\"https:\/\/luajit.org\/download.html\">https:\/\/luajit.org\/download.html<\/a> <\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/07\/LuaJIT-2.1.0-beta3.7z.zip\">LuaJIT-2.1.0-beta3.7z<\/a><a href=\"http:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2020\/07\/LuaJIT-2.1.0-beta3.7z.zip\" class=\"wp-block-file__button\" download>\u4e0b\u8f7d<\/a><\/div>\n\n\n\n<p>2\u3001\u627e\u5230VC\u7f16\u8bd1\u547d\u4ee4\u884c\uff0c\u4ee5VS2019\u4e3a\u4f8b\uff0c\u5206\u522b\u4f4d\u4e8e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Visual Studio 019\\Visual Studio Tools\\VC\\x64 Native Tools Command Prompt for VS 2019\n\nC:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Visual Studio 2019\\Visual Studio Tools\\VC\\x86 Native Tools Command Prompt for VS 2019\n\n\u5176\u5b9e\u5206\u522b\u8c03\u7528\u7684\u662f\uff1a\n\ncmd \/k \"d:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\"\n\ncmd \/k \"d:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars32.bat\"<\/code><\/pre>\n\n\n\n<p>3\u3001\u7f16\u8bd164\u4f4d\u7248\u672c\uff0c\u8fd0\u884cx64 Native Tools Command Prompt for VS 2019\uff0c\u8fdb\u5165\u5230luajit-2.1\/src\u76ee\u5f55\u4e2d\uff0c\u67e5\u770bmsvcbuild.bat\uff0c\u91cc\u9762\u6709<br>@if &#8220;%1&#8243;==&#8221;static&#8221; goto :STATIC<br>\u5373\u8f93\u5165\u53c2\u6570\u53ef\u4ee5\u4e3astatic<br>\u6267\u884c\uff1amsvcbuild.bat static \u5373\u53ef\u7f16\u8bd1\u751f\u6210 luajit.exe 64\u4f4d\u7248\u672c\uff0cexe\u4f4d\u4e8eluajit-2.1\u76ee\u5f55\u4e2d<\/p>\n\n\n\n<p>4\u3001\u7f16\u8bd132\u4f4d\u7248\uff0c\u5219\u8fd0\u884cx86 Native Tools Command Prompt for VS 2019\uff0c\u518d\u8fdb\u5165scr\u76ee\u5f55\uff0c\u518d\u8fd0\u884cmsvcbuild.bat static\u53ef\u751f\u6210luajit.exe 32\u4f4d\u7248\u672c<\/p>\n\n\n\n<p>msvcbuild.bat gc64 \u751f\u621064\u4f4d\u7248\u672c<\/p>\n\n\n\n<p>luajit.exe -b input.lua output.lua<br>\u548c\u4ee5\u4e0b\u662f\u4e00\u6837\u7684<br>local bytecode=string.dump(loadstring(&#8221;))<br>io.ope(dst,&#8221;w+b&#8221;):write(bytecode)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u4e0b\u8f7d https:\/\/luajit.org\/download.html 2\u3001\u627e\u5230VC\u7f16\u8bd1\u547d\u4ee4\u884c\uff0c\u4ee5VS20 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/2065"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2065"}],"version-history":[{"count":12,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/2065\/revisions"}],"predecessor-version":[{"id":2084,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/2065\/revisions\/2084"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}