{"id":95058,"date":"2026-08-16T07:49:08","date_gmt":"2026-08-15T23:49:08","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/95058.html"},"modified":"2026-08-16T07:49:08","modified_gmt":"2026-08-15T23:49:08","slug":"%e5%88%a9%e7%94%a8rdynamic%e7%bc%96%e8%af%91%e9%80%89%e9%a1%b9%e8%a7%a3%e5%86%b3tcc-for-windows%e7%9a%84%e5%8a%a0%e8%bd%bd%e5%8a%a8%e6%80%81%e5%ba%93%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/95058.html","title":{"rendered":"\u5229\u7528rdynamic\u7f16\u8bd1\u9009\u9879\u89e3\u51b3tcc for windows\u7684\u52a0\u8f7d\u52a8\u6001\u5e93\u95ee\u9898"},"content":{"rendered":"<p>\u4e0a\u6587\u5199\u5230&#xff0c;tcc for windows\u7f16\u8bd1\u7684so\u4e0d\u80fd\u88abluajit\u63d2\u4ef6\u8c03\u7528\u3002\u518d\u6765\u8bd5\u5176\u4ed6\u7f16\u8bd1\u5668\u3002 \u5728windows\u7528mingw \u7f16\u8bd1\u7684so\u80fd\u88abluajit\u63d2\u4ef6\u8c03\u7528\u3002<\/p>\n<p>C:\\\\Users\\\\lt&gt;cd\\\\d<\/p>\n<p>C:\\\\d&gt;ss<\/p>\n<p>C:\\\\d&gt;set path&#061;C:\\\\WINDOWS\\\\system32;C:\\\\WINDOWS;C:\\\\WINDOWS\\\\System32\\\\Wbem;C:\\\\WINDOWS\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\;C:\\\\WINDOWS\\\\System32\\\\OpenSSH\\\\;C:\\\\Program Files\\\\Git\\\\cmd;C:\\\\Users\\\\lt\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python313\\\\Scripts\\\\;C:\\\\Users\\\\lt\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python313\\\\;C:\\\\Users\\\\lt\\\\AppData\\\\Local\\\\Microsoft\\\\WindowsApps;;C:\\\\Users\\\\lt\\\\AppData\\\\Local\\\\Programs\\\\Ollama;C:\\\\Users\\\\lt\\\\.dotnet\\\\tools;C:\\\\d\\\\mingw64\\\\bin;C:\\\\d\\\\pypy<\/p>\n<p>C:\\\\d&gt;gcc -shared -fPIC -o libsudoku_c6.so sudoku_solve.c<\/p>\n<p>C:\\\\d&gt;duckdb155<br \/>\nDuckDB v1.5.5 (Variegata)<br \/>\nEnter &#034;.help&#034; for usage hints.<br \/>\nmemory D load luajit;<br \/>\nmemory D SELECT * FROM luajit_module(mode :&#061; &#039;compile&#039;, sql_name :&#061; &#039;sudoku_c&#039;, source :&#061; &#039;<br \/>\n         return function(p)<br \/>\n           local ffi &#061; require(&#034;ffi&#034;)<br \/>\n           ffi.cdef[[ int sudoku_solve(const char *p, char *out); ]]<br \/>\n           local lib &#061; ffi.load(&#034;.\/libsudoku_c6.so&#034;)<br \/>\n           local buf &#061; ffi.new(&#034;char[82]&#034;)<br \/>\n           local rc &#061; lib.sudoku_solve(p, buf)<br \/>\n           if rc ~&#061; 1 then return NULL end<br \/>\n           return ffi.string(buf)<br \/>\n         end<br \/>\n         &#039;);<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502   ok    \u2502  mode   \u2502  phase  \u2502 message \u2502 detail  \u2502 sql_name \u2502<br \/>\n\u2502 boolean \u2502 varchar \u2502 varchar \u2502 varchar \u2502 varchar \u2502 varchar  \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 true    \u2502 compile \u2502 compile \u2502 OK      \u2502         \u2502 sudoku_c \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\nmemory D SELECT luajit_s(&#039;sudoku_c&#039;, &#039;000001002000020030004500600007600050080090006100005800001004000070900003400030020&#039;);<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 luajit_s(&#039;sudoku_c&#039;, &#039;000001002000020030004500600007600050080090006100005800001004000070900003400030020&#039;) \u2502<br \/>\n\u2502                                                  varchar                                                  \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 359461782716829534824573619947682351583197246162345897631254978275918463498736125                         \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\nmemory D SELECT * FROM luajit_module(mode :&#061; &#039;compile&#039;, sql_name :&#061; &#039;sudoku_c&#039;, source :&#061; &#039;<br \/>\n         return function(p)<br \/>\n           local ffi &#061; require(&#034;ffi&#034;)<br \/>\n           ffi.cdef[[ int sudoku_solve(const char *p, char *out); ]]<br \/>\n           local lib &#061; ffi.load(&#034;.\/libsudoku_c.so&#034;)<br \/>\n           local buf &#061; ffi.new(&#034;char[82]&#034;)<br \/>\n           local rc &#061; lib.sudoku_solve(p, buf)<br \/>\n           if rc ~&#061; 1 then return NULL end<br \/>\n           return ffi.string(buf)<br \/>\n         end<br \/>\n         &#039;);<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502   ok    \u2502  mode   \u2502  phase  \u2502 message \u2502 detail  \u2502 sql_name \u2502<br \/>\n\u2502 boolean \u2502 varchar \u2502 varchar \u2502 varchar \u2502 varchar \u2502 varchar  \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 true    \u2502 compile \u2502 compile \u2502 OK      \u2502         \u2502 sudoku_c \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\nmemory D SELECT luajit_s(&#039;sudoku_c&#039;, &#039;000001002000020030004500600007600050080090006100005800001004000070900003400030020&#039;);<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 luajit_s(&#039;sudoku_c&#039;, &#039;000001002000020030004500600007600050080090006100005800001004000070900003400030020&#039;) \u2502<br \/>\n\u2502                                                  varchar                                                  \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 NULL                                                                                                      \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\nmemory D<\/p>\n<p>\u5728luajit\u4e2d\u8c03\u8bd5\u8f83\u96be&#xff0c;\u6539\u7528\u4e00\u4e2ac\u6e90\u6587\u4ef6\u6765\u5728tcc\u4e2d\u8c03\u8bd5\u3002<\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;stdio.h&gt;<\/span><\/span><br \/>\n<span class=\"token keyword\">int<\/span> <span class=\"token function\">sudoku_solve<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">const<\/span> <span class=\"token keyword\">char<\/span> <span class=\"token operator\">*<\/span>p<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">char<\/span> <span class=\"token operator\">*<\/span>out<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">int<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u4e00\u4e2a\u7b80\u5355\u7684\u6570\u72ec\u9898\u76ee<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> <span class=\"token keyword\">char<\/span> <span class=\"token operator\">*<\/span>puzzle <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;530070000600195000098000060800060003400803001700020006060000280000419005000080079&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">char<\/span> solution<span class=\"token punctuation\">[<\/span><span class=\"token number\">82<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">sudoku_solve<\/span><span class=\"token punctuation\">(<\/span>puzzle<span class=\"token punctuation\">,<\/span> solution<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Solution found!\\\\n&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> i <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> i <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">9<\/span><span class=\"token punctuation\">;<\/span> i<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> j <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> j <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">9<\/span><span class=\"token punctuation\">;<\/span> j<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;%c &#034;<\/span><span class=\"token punctuation\">,<\/span> solution<span class=\"token punctuation\">[<\/span>i <span class=\"token operator\">*<\/span> <span class=\"token number\">9<\/span> <span class=\"token operator\">&#043;<\/span> j<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n            <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\\\\n&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;No solution exists.\\\\n&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u795e\u5947&#xff0c;tcc\u7f16\u8bd1main\u51fd\u6570\u6e90\u6587\u4ef6\u65f6&#xff0c;\u4e0d\u8bc6\u522btcc \u81ea\u5df1\u7f16\u7684so\u6587\u4ef6&#xff0c;\u5374\u80fd\u8bc6\u522bmingw\u7f16\u7684\u3002<\/p>\n<p>C:\\\\d&gt;tcc\\\\tcc callsd.c .\/libsudoku_c.so -o callsdt.exe<br \/>\ntcc: error: undefined symbol &#039;sudoku_solve&#039;<\/p>\n<p>C:\\\\d&gt;tcc\\\\tcc callsd.c .\/libsudoku_c6.so -o callsdt.exe<\/p>\n<p>C:\\\\d&gt;callsdt<br \/>\nSolution found!<br \/>\n5 3 4 6 7 8 9 1 2<\/p>\n<p>\u67e5\u770btcc\u547d\u4ee4\u884c\u5e2e\u52a9\u4fe1\u606f\u89e3\u51b3\u4e86\u3002windows\u4e2dtcc\u540c\u65f6\u7528-shared\u548crdynamic\u8fd9\u4e24\u4e2a\u9009\u9879\u7f16\u8bd1\u5c31\u59a5\u4e86\u3002<\/p>\n<p>tcc &#8211;help<br \/>\n  -shared     generate a shared library\/dll<br \/>\n  -rdynamic   export all global symbols to dynamic linker<br \/>\nC:\\\\d&gt;tcc\\\\tcc -shared  -rdynamic -o libsudoku_c.dll dlxdll.c<\/p>\n<p>\u7f16\u8bd1\u540c\u65f6\u4ea7\u751f\u4e86libsudoku_c2.def\u6587\u4ef6&#xff0c;\u5185\u5bb9\u5982\u4e0b&#xff1a;<\/p>\n<p>LIBRARY libsudoku_c2.dll<\/p>\n<p>EXPORTS<br \/>\nDllMain<br \/>\n_dllstart<br \/>\n_edata<br \/>\n_end<br \/>\n_etext<br \/>\nsudoku_solve<\/p>\n<p>\u7136\u540e\u7f16\u8bd1\u5c31\u4e0d\u62a5tcc: error: undefined symbol &#039;sudoku_solve&#039;\u9519\u4e86\u3002<\/p>\n<p>C:\\\\d&gt;tcc\\\\tcc callsd.c .\/libsudoku_c.dll -o callsdt2.exe<br \/>\nC:\\\\d&gt;callsdt2.exe<br \/>\nSolution found!<br \/>\n5 3 4 6 7 8 9 1 2<br \/>\n6 7 2 1 9 5 3 4 8<br \/>\n1 9 8 3 4 2 5 6 7<br \/>\n8 5 9 7 6 1 4 2 3<br \/>\n4 2 6 8 5 3 7 9 1<br \/>\n7 1 3 9 2 4 8 5 6<br \/>\n9 6 1 5 3 7 2 8 4<br \/>\n2 8 7 4 1 9 6 3 5<br \/>\n3 4 5 2 8 6 1 7 9<\/p>\n<p>\u518d\u7528\u53e6\u4e00\u79cd\u7b97\u6cd5\u7684\u6e90\u6587\u4ef6\u7f16\u8bd1dll\u4e5f\u6b63\u786e\u3002<\/p>\n<p>C:\\\\d&gt;tcc\\\\tcc -shared  -rdynamic -o libsudoku_c2.dll sudoku_solve.c<\/p>\n<p>C:\\\\d&gt;tcc\\\\tcc callsd.c .\/libsudoku_c2.dll -o callsdt3.exe<\/p>\n<p>C:\\\\d&gt;callsdt3.exe<br \/>\nSolution found!<br \/>\n5 3 4 6 7 8 9 1 2<br \/>\n6 7 2 1 9 5 3 4 8<br \/>\n1 9 8 3 4 2 5 6 7<br \/>\n8 5 9 7 6 1 4 2 3<br \/>\n4 2 6 8 5 3 7 9 1<br \/>\n7 1 3 9 2 4 8 5 6<br \/>\n9 6 1 5 3 7 2 8 4<br \/>\n2 8 7 4 1 9 6 3 5<br \/>\n3 4 5 2 8 6 1 7 9<\/p>\n<p>\u8fd9\u6837\u7f16\u8bd1\u51fa\u7684\u52a8\u6001\u5e93\u5728luajit\u4e2d\u4e5f\u80fd\u6b63\u786e\u8bc6\u522b\u3002<\/p>\n<p>C:\\\\d&gt;duckdb155<br \/>\nDuckDB v1.5.5 (Variegata)<br \/>\nEnter &#034;.help&#034; for usage hints.<br \/>\nmemory D load luajit;<br \/>\nmemory D SELECT * FROM luajit_module(mode :&#061; &#039;compile&#039;, sql_name :&#061; &#039;sudoku_c&#039;, source :&#061; &#039;<br \/>\n         return function(p)<br \/>\n           local ffi &#061; require(&#034;ffi&#034;)<br \/>\n           ffi.cdef[[ int sudoku_solve(const char *p, char *out); ]]<br \/>\n           local lib &#061; ffi.load(&#034;.\/libsudoku_c2.dll&#034;)<br \/>\n           local buf &#061; ffi.new(&#034;char[82]&#034;)<br \/>\n           local rc &#061; lib.sudoku_solve(p, buf)<br \/>\n           if rc ~&#061; 1 then return NULL end<br \/>\n           return ffi.string(buf)<br \/>\n         end<br \/>\n         &#039;);<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502   ok    \u2502  mode   \u2502  phase  \u2502 message \u2502 detail  \u2502 sql_name \u2502<br \/>\n\u2502 boolean \u2502 varchar \u2502 varchar \u2502 varchar \u2502 varchar \u2502 varchar  \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 true    \u2502 compile \u2502 compile \u2502 OK      \u2502         \u2502 sudoku_c \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<br \/>\nmemory D SELECT luajit_s(&#039;sudoku_c&#039;, &#039;000001002000020030004500600007600050080090006100005800001004000070900003400030020&#039;);<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 luajit_s(&#039;sudoku_c&#039;, &#039;000001002000020030004500600007600050080090006100005800001004000070900003400030020&#039;) \u2502<br \/>\n\u2502                                                  varchar                                                  \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 359461782716829534824573619947682351583197246162345897631254978275918463498736125                         \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n<p>\u8fd9\u6837&#xff0c;tcc for windows\u7684\u52a0\u8f7d\u52a8\u6001\u5e93\u95ee\u9898\u89e3\u51b3\u4e86&#xff0c;\u5947\u602atcc\u5728linux\u4e2d\u7f16\u8bd1\u4e0d\u9700\u8981rdynamic\u9009\u9879\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u6587\u5199\u5230&#xff0c;tcc for windows\u7f16\u8bd1\u7684so\u4e0d\u80fd\u88abluajit\u63d2\u4ef6\u8c03\u7528\u3002\u518d\u6765\u8bd5\u5176\u4ed6\u7f16\u8bd1\u5668\u3002 \u5728windows\u7528mingw \u7f16\u8bd1\u7684so\u80fd\u88abluajit\u63d2\u4ef6\u8c03\u7528\u3002<br \/>\nC:\\\\Users\\\\lt&gt;cd\\\\dC:\\\\d&gt;ssC:\\\\d&gt;set pathC:\\\\WINDOWS\\\\system32;C:\\\\WINDOWS;C:\\\\WINDOWS\\\\System32\\\\Wbem;C:\\\\WINDOWS\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\;C:\\\\WINDOWS\\\\Sy<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10187,174,149,270,269],"topic":[],"class_list":["post-95058","post","type-post","status-publish","format-standard","hentry","category-server","tag-codingplan","tag-c","tag-windows","tag-270","tag-269"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5229\u7528rdynamic\u7f16\u8bd1\u9009\u9879\u89e3\u51b3tcc for windows\u7684\u52a0\u8f7d\u52a8\u6001\u5e93\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/95058.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5229\u7528rdynamic\u7f16\u8bd1\u9009\u9879\u89e3\u51b3tcc for windows\u7684\u52a0\u8f7d\u52a8\u6001\u5e93\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e0a\u6587\u5199\u5230&#xff0c;tcc for windows\u7f16\u8bd1\u7684so\u4e0d\u80fd\u88abluajit\u63d2\u4ef6\u8c03\u7528\u3002\u518d\u6765\u8bd5\u5176\u4ed6\u7f16\u8bd1\u5668\u3002 \u5728windows\u7528mingw \u7f16\u8bd1\u7684so\u80fd\u88abluajit\u63d2\u4ef6\u8c03\u7528\u3002 C:\\Users\\lt&gt;cd\\dC:\\d&gt;ssC:\\d&gt;set pathC:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\Sy\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/95058.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-15T23:49:08+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/95058.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/95058.html\",\"name\":\"\u5229\u7528rdynamic\u7f16\u8bd1\u9009\u9879\u89e3\u51b3tcc for windows\u7684\u52a0\u8f7d\u52a8\u6001\u5e93\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-15T23:49:08+00:00\",\"dateModified\":\"2026-08-15T23:49:08+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/95058.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/95058.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/95058.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5229\u7528rdynamic\u7f16\u8bd1\u9009\u9879\u89e3\u51b3tcc for windows\u7684\u52a0\u8f7d\u52a8\u6001\u5e93\u95ee\u9898\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5229\u7528rdynamic\u7f16\u8bd1\u9009\u9879\u89e3\u51b3tcc for windows\u7684\u52a0\u8f7d\u52a8\u6001\u5e93\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/95058.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5229\u7528rdynamic\u7f16\u8bd1\u9009\u9879\u89e3\u51b3tcc for windows\u7684\u52a0\u8f7d\u52a8\u6001\u5e93\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e0a\u6587\u5199\u5230&#xff0c;tcc for windows\u7f16\u8bd1\u7684so\u4e0d\u80fd\u88abluajit\u63d2\u4ef6\u8c03\u7528\u3002\u518d\u6765\u8bd5\u5176\u4ed6\u7f16\u8bd1\u5668\u3002 \u5728windows\u7528mingw \u7f16\u8bd1\u7684so\u80fd\u88abluajit\u63d2\u4ef6\u8c03\u7528\u3002 C:\\Users\\lt&gt;cd\\dC:\\d&gt;ssC:\\d&gt;set pathC:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\Sy","og_url":"https:\/\/www.wsisp.com\/helps\/95058.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-15T23:49:08+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/95058.html","url":"https:\/\/www.wsisp.com\/helps\/95058.html","name":"\u5229\u7528rdynamic\u7f16\u8bd1\u9009\u9879\u89e3\u51b3tcc for windows\u7684\u52a0\u8f7d\u52a8\u6001\u5e93\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-15T23:49:08+00:00","dateModified":"2026-08-15T23:49:08+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/95058.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/95058.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/95058.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5229\u7528rdynamic\u7f16\u8bd1\u9009\u9879\u89e3\u51b3tcc for windows\u7684\u52a0\u8f7d\u52a8\u6001\u5e93\u95ee\u9898"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/95058","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=95058"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/95058\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=95058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=95058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=95058"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=95058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}