{"id":119791,"date":"2026-10-30T12:24:47","date_gmt":"2026-10-30T04:24:47","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/119791.html"},"modified":"2026-10-30T12:24:47","modified_gmt":"2026-10-30T04:24:47","slug":"c17-%c2%b7-cmake-3-20-%c2%b7-http-https-%c2%b7-%e9%9d%99%e6%80%81%e5%ba%93%e9%9b%86%e6%88%90-%c2%b7-%e5%8f%af%e9%aa%8c%e8%af%81%e4%ba%a4%e4%bb%98-ai%e5%a4%a7%e6%a8%a1%e5%9e%8bsdk%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/119791.html","title":{"rendered":"C++17 \u00b7 CMake 3.20+ \u00b7 HTTP\/HTTPS \u00b7 \u9759\u6001\u5e93\u96c6\u6210 \u00b7 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8 AI\u5927\u6a21\u578bSDK\u5b9e\u6218\uff5cChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c"},"content":{"rendered":"<h2>C&#043;&#043;17\u00a0 \u00b7\u00a0 CMake 3.20&#043;\u00a0 \u00b7\u00a0 HTTP\/HTTPS\u00a0 \u00b7\u00a0 \u9759\u6001\u5e93\u96c6\u6210\u00a0 \u00b7\u00a0 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8<\/h2>\n<h2>AI\u5927\u6a21\u578bSDK\u5b9e\u6218&#xff5c;ChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c\u5b9a\u4f4d<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"363\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042444-6ae41c0cae676.jpg\" width=\"645\" \/><\/p>\n<p>#C&#043;&#043;\u00a0 #CMake\u00a0 #CMakeLists.txt\u00a0 #ChatServer\u00a0 #AI\u5927\u6a21\u578b\u00a0 #SDK\u5f00\u53d1\u00a0 #HTTP\u670d\u52a1\u5668\u00a0 #\u9759\u6001\u5e93\u94fe\u63a5\u00a0 #Linux\u00a0 #\u5de5\u7a0b\u5316<\/p>\n<p>ChatServer \u4e3a\u4ec0\u4e48\u5728\u5f00\u53d1\u673a\u4e0a\u80fd\u7f16\u8bd1&#xff0c;\u6362\u4e2a\u73af\u5883\u5374\u627e\u4e0d\u5230\u5934\u6587\u4ef6\u3001\u9759\u6001\u5e93\u6216\u8fd0\u884c\u65f6\u4f9d\u8d56&#xff1f;\u6839\u6e90\u5e38\u5728 CMake \u76ee\u6807\u8bbe\u8ba1\u3001\u4f9d\u8d56\u4f20\u64ad\u4e0e\u6784\u5efa\u914d\u7f6e&#xff0c;\u800c\u4e0d\u53ea\u662f\u6e90\u4ee3\u7801\u3002\u672c\u6587\u56f4\u7ed5 C&#043;&#043;17 \u5927\u6a21\u578b\u804a\u5929\u670d\u52a1&#xff0c;\u7ed9\u51fa\u5de5\u7a0b\u76ee\u5f55\u3001\u73b0\u4ee3 CMakeLists.txt\u3001\u81ea\u7814 SDK \u5bfc\u5165\u3001HTTP\/JSON \u7ec4\u4ef6\u63a5\u5165\u3001Debug \u4e0e Release \u7f16\u8bd1\u3001CTest \u81ea\u68c0\u3001\u63a5\u53e3\u9a8c\u8bc1\u53ca\u9ad8\u9891\u6545\u969c\u6392\u67e5\u7684\u5b8c\u6574\u8def\u5f84\u3002\u793a\u4f8b\u5305\u542b\u5177\u5907\u660e\u786e\u4f9d\u8d56\u524d\u63d0\u7684\u670d\u52a1\u4ee3\u7801\u3001\u672c\u5730\u6f14\u793a\u6a21\u5f0f&#xff0c;\u4ee5\u53ca\u901a\u8fc7\u73af\u5883\u53d8\u91cf\u63a5\u5165\u517c\u5bb9 HTTPS \u6a21\u578b\u63a5\u53e3\u7684\u771f\u5b9e\u8c03\u7528\u8fb9\u754c\u3002\u901a\u8fc7\u89e3\u6790\u914d\u7f6e\u3001\u7f16\u8bd1\u3001\u94fe\u63a5\u3001\u8fd0\u884c\u4e0e\u4ea4\u4ed8\u4e4b\u95f4\u7684\u5dee\u5f02&#xff0c;\u5e2e\u52a9\u8bfb\u8005\u5b8c\u6210\u4f9d\u8d56\u6e05\u6670\u3001\u53ef\u590d\u73b0\u3001\u53ef\u6392\u9519\u7684 ChatServer \u5de5\u7a0b\u3002<\/p>\n<p>\u9605\u8bfb\u7ea6\u5b9a&#xff1a;\u6587\u4e2d\u201c\u6f14\u793a\u6a21\u5f0f\u201d\u4e0d\u53d1\u9001\u5916\u90e8\u6a21\u578b\u8bf7\u6c42&#xff1b;\u201c\u771f\u5b9e\u6a21\u5f0f\u201d\u901a\u8fc7\u670d\u52a1\u7aef\u914d\u7f6e\u8c03\u7528\u517c\u5bb9\u7684 HTTPS \u63a5\u53e3\u3002\u81ea\u7814 SDK \u7684\u5177\u4f53\u4e1a\u52a1 API \u9700\u6309\u5176\u516c\u5f00\u5934\u6587\u4ef6\u9002\u914d\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>01\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u5199\u5728\u524d\u9762&#xff5c;\u4e3a\u4ec0\u4e48\u201c\u7f16\u8bd1\u6210\u529f\u201d\u4ecd\u7136\u4e0d\u80fd\u4ea4\u4ed8&#xff1f;<\/h2>\n<p style=\"margin-left:8.65pt;margin-right:8.65pt\"><span style=\"background-color:#e8f5f4\">\u6700\u5bb9\u6613\u88ab\u5ffd\u7565\u7684\u4e09\u4ef6\u4e8b&#xff1a;CMake \u914d\u7f6e\u901a\u8fc7 \u2260 \u94fe\u63a5\u6b63\u786e&#xff1b;\u94fe\u63a5\u6b63\u786e \u2260 \u8fd0\u884c\u73af\u5883\u5b8c\u6574&#xff1b;\u670d\u52a1\u542f\u52a8 \u2260 \u6a21\u578b\u8c03\u7528\u6709\u6548\u3002<\/span><\/p>\n<p>\u8bbe\u60f3\u4e00\u4e2a\u5178\u578b\u573a\u666f&#xff1a;ChatServer \u5728\u5f00\u53d1\u673a\u4e0a\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c&#xff0c;\u8fc1\u79fb\u5230\u53e6\u4e00\u53f0\u73af\u5883\u540e\u5374\u4f9d\u6b21\u51fa\u73b0\u201c\u627e\u4e0d\u5230 OpenSSL\u201d\u201cundefined reference\u201d\u201c\u8fd0\u884c\u65f6\u627e\u4e0d\u5230\u52a8\u6001\u5e93\u201d\u3002\u5982\u679c\u53ea\u5728\u9519\u8bef\u51fa\u73b0\u65f6\u8865\u4e00\u6761 -L \u6216 -l&#xff0c;\u5de5\u7a0b\u4f1a\u4e0d\u65ad\u79ef\u7d2f\u9690\u6027\u4f9d\u8d56\u3002\u66f4\u7a33\u59a5\u7684\u505a\u6cd5&#xff0c;\u662f\u8ba9\u6bcf\u4e2a\u76ee\u6807\u663e\u5f0f\u58f0\u660e\u81ea\u5df1\u9700\u8981\u7684\u5e93\u3001\u5934\u6587\u4ef6\u4e0e\u7f16\u8bd1\u7ea6\u675f\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u8bfb\u5b8c\u53ef\u4ee5\u5b9e\u9645\u5b8c\u6210\u4ec0\u4e48<\/h3>\n<table align=\"center\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u9636\u6bb5<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u53ef\u9a8c\u8bc1\u7684\u4ea7\u7269<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5931\u8d25\u65f6\u7684\u7b2c\u4e00\u68c0\u67e5\u9879<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u914d\u7f6e<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u751f\u6210\u6784\u5efa\u89c4\u5219<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5305\u914d\u7f6e\u8def\u5f84\u3001\u7248\u672c\u3001\u751f\u6210\u5668<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u7f16\u8bd1<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u751f\u6210 .o \/ .obj<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5305\u542b\u8def\u5f84\u3001\u9884\u5904\u7406\u5b8f\u3001C&#043;&#043;\u6807\u51c6<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u94fe\u63a5<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5f62\u6210\u53ef\u6267\u884c\u6587\u4ef6<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u7b26\u53f7\u3001\u5b9e\u9645\u5e93\u6587\u4ef6\u3001ABI<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u8fd0\u884c<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">HTTP \u63a5\u53e3\u8fd4\u56de\u9884\u671f\u72b6\u6001<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u52a8\u6001\u5e93\u3001\u73af\u5883\u53d8\u91cf\u3001\u7f51\u7edc\u4e0e\u8bc1\u4e66<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4ea4\u4ed8<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u72ec\u7acb\u76ee\u5f55\u53ef\u91cd\u65b0\u6784\u5efa<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">Preset\u3001CTest\u3001\u5b89\u88c5\u6e05\u5355<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u5feb\u901f\u8def\u5f84&#xff1a;\u5148\u6784\u5efa\u6700\u5c0f\u95ed\u73af&#xff0c;\u518d\u8fde\u63a5\u771f\u5b9e SDK<\/h3>\n<p>\u7b2c\u4e00\u6b65&#xff1a;\u53ea\u542f\u52a8 \/health \u4e0e\u6f14\u793a\u804a\u5929\u63a5\u53e3&#xff0c;\u9a8c\u8bc1\u7f51\u7edc\u670d\u52a1\u3001JSON \u548c\u6784\u5efa\u7cfb\u7edf&#xff1b;\u7b2c\u4e8c\u6b65&#xff1a;\u901a\u8fc7\u5b89\u88c5\u524d\u7f00\u627e\u5230\u81ea\u7814 SDK&#xff0c;\u5e76\u628a\u9759\u6001\u5e93\u5c01\u88c5\u4e3a\u5bfc\u5165\u76ee\u6807&#xff1b;\u7b2c\u4e09\u6b65&#xff1a;\u518d\u5c06\u4e1a\u52a1\u9002\u914d\u5c42\u66ff\u6362\u4e3a\u771f\u5b9e SDK \u8c03\u7528\u3002\u8fd9\u6837\u6bcf\u4e00\u6b65\u90fd\u6709\u72ec\u7acb\u68c0\u67e5\u70b9&#xff0c;\u907f\u514d\u628a\u6240\u6709\u95ee\u9898\u6df7\u5728\u4e00\u8d77\u3002<\/p>\n<p style=\"margin-left:8.65pt;margin-right:8.65pt\"><span style=\"background-color:#e8f5f4\">\u4e00\u53e5\u8bdd\u76ee\u6807&#xff1a;\u628a\u201c\u672c\u673a\u80fd\u8dd1\u201d\u6539\u9020\u4e3a\u201c\u4f9d\u8d56\u6e05\u695a\u3001\u6784\u5efa\u53ef\u590d\u73b0\u3001\u7ed3\u679c\u53ef\u68c0\u67e5\u3001\u6545\u969c\u80fd\u5b9a\u4f4d\u201d\u3002<\/span><\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>02\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u5148\u7406\u89e3\u6784\u5efa\u5168\u94fe\u8def&#xff1a;\u4e94\u4e2a\u9636\u6bb5&#xff0c;\u4e94\u7c7b\u9519\u8bef<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"322\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042444-6ae41c0ccf310.jpg\" width=\"629\" \/><\/p>\n<p style=\"text-align:center\">\u56fe 1&#xff5c;\u914d\u7f6e\u3001\u751f\u6210\u3001\u7f16\u8bd1\u3001\u94fe\u63a5\u3001\u8fd0\u884c\u7684\u804c\u8d23\u8fb9\u754c<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u4e00\u4e2a\u9519\u8bef\u4fe1\u606f&#xff0c;\u5148\u5224\u65ad\u5b83\u5c5e\u4e8e\u54ea\u4e00\u6b65<\/h3>\n<p>\u2022\u00a0 \u914d\u7f6e\u9636\u6bb5&#xff1a;\u627e\u4e0d\u5230 xxxConfig.cmake \u6216\u4f9d\u8d56\u7248\u672c\u4e0d\u5339\u914d&#xff1b;\u4f18\u5148\u68c0\u67e5 CMAKE_PREFIX_PATH\u3001\u5de5\u5177\u94fe\u6587\u4ef6\u548c\u5305\u7684\u5b89\u88c5\u4f4d\u7f6e\u3002<\/p>\n<p>\u2022\u00a0 \u7f16\u8bd1\u9636\u6bb5&#xff1a;fatal error: xxx.h: No such file or directory&#xff1b;\u4f18\u5148\u68c0\u67e5\u76ee\u6807\u4f7f\u7528\u7684\u5934\u6587\u4ef6\u641c\u7d22\u8def\u5f84&#xff0c;\u800c\u4e0d\u662f\u76f2\u76ee\u8ffd\u52a0\u7cfb\u7edf\u8def\u5f84\u3002<\/p>\n<p>\u2022\u00a0 \u94fe\u63a5\u9636\u6bb5&#xff1a;undefined reference \/ LNK2019&#xff1b;\u4f18\u5148\u786e\u8ba4\u5b9e\u73b0\u662f\u5426\u8fdb\u5165\u76ee\u6807\u3001\u4f9d\u8d56\u662f\u5426\u94fe\u63a5\u3001\u9759\u6001\u5e93 ABI \u4e0e\u67b6\u6784\u662f\u5426\u4e00\u81f4\u3002<\/p>\n<p>\u2022\u00a0 \u8fd0\u884c\u9636\u6bb5&#xff1a;\u670d\u52a1\u7aef\u53e3\u672a\u76d1\u542c\u3001\u8bc1\u4e66\u6821\u9a8c\u5931\u8d25\u6216\u627e\u4e0d\u5230\u5171\u4eab\u5e93&#xff1b;\u6784\u5efa\u6210\u529f\u5e76\u4e0d\u4f1a\u81ea\u52a8\u89e3\u51b3\u8fd0\u884c\u65f6\u4f9d\u8d56\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u4e3a\u4ec0\u4e48\u8981\u533a\u5206\u914d\u7f6e\u4e0e\u6784\u5efa<\/h3>\n<p>cmake -S . -B build \u8d1f\u8d23\u8bfb\u53d6 CMakeLists.txt \u5e76\u751f\u6210\u89c4\u5219&#xff1b;cmake &#8211;build build \u624d\u771f\u6b63\u89e6\u53d1\u7f16\u8bd1\u4e0e\u94fe\u63a5\u3002\u6539\u52a8 CMake \u914d\u7f6e\u540e\u5e94\u91cd\u65b0\u8fd0\u884c\u914d\u7f6e&#xff1b;\u53ea\u6539\u52a8\u6e90\u6587\u4ef6\u5219\u901a\u5e38\u4ea4\u7ed9\u589e\u91cf\u6784\u5efa\u5373\u53ef\u3002<\/p>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE&#061;Debug<br \/>\ncmake &#8211;build build &#8211;parallel<br \/>\nctest &#8211;test-dir build &#8211;output-on-failure<\/span><\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>03\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">ChatServer \u653e\u5728\u4ec0\u4e48\u4f4d\u7f6e&#xff1a;\u804c\u8d23\u8fb9\u754c\u6bd4\u5e93\u540d\u66f4\u91cd\u8981<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"322\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042444-6ae41c0ced315.jpg\" width=\"629\" \/><\/p>\n<p style=\"text-align:center\">\u56fe 2&#xff5c;\u4ece HTTP \u8bf7\u6c42\u5230\u6a21\u578b\u54cd\u5e94&#xff1a;ChatServer \u4f5c\u4e3a\u670d\u52a1\u5c42<\/p>\n<p>ChatServer \u662f\u9762\u5411\u5ba2\u6237\u7aef\u7684\u670d\u52a1\u5165\u53e3&#xff1a;\u63a5\u6536 HTTP\u3001\u9a8c\u8bc1\u53c2\u6570\u3001\u63a7\u5236\u8bbf\u95ee\u65b9\u5f0f\u3001\u8c03\u7528\u4e0b\u6e38\u80fd\u529b&#xff0c;\u5e76\u5c06\u7ed3\u679c\u89c4\u8303\u5316\u4e3a JSON\u3002ChatSDK \u5219\u8d1f\u8d23\u5c4f\u853d\u6a21\u578b\u4f9b\u5e94\u65b9\u4e4b\u95f4\u7684\u5dee\u5f02&#xff0c;\u4f8b\u5982\u6a21\u578b\u540d\u79f0\u3001\u9274\u6743\u65b9\u5f0f\u4e0e\u8bf7\u6c42\u534f\u8bae\u3002\u4e24\u8005\u62c6\u5206\u540e&#xff0c;\u670d\u52a1\u5165\u53e3\u548c\u6a21\u578b\u5b9e\u73b0\u53ef\u4ee5\u72ec\u7acb\u66ff\u6362\u3002<\/p>\n<table align=\"center\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5c42\u6b21<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u8d1f\u8d23<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4e0d\u5e94\u8d1f\u8d23<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">HTTP \u5c42<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u8def\u7531\u3001\u72b6\u6001\u7801\u3001\u8bf7\u6c42\u4f53\u9650\u5236<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5728\u524d\u7aef\u786c\u7f16\u7801\u5bc6\u94a5<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4e1a\u52a1\u5c42<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6821\u9a8c\u3001\u4f1a\u8bdd\u3001\u7edf\u4e00\u9519\u8bef<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4f9d\u8d56\u4efb\u610f\u5168\u5c40\u94fe\u63a5\u76ee\u5f55<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">SDK\/\u9002\u914d\u5c42<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6a21\u578b\u8c03\u7528\u3001\u91cd\u8bd5\u4e0e\u8d85\u65f6\u7b56\u7565<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6df7\u5408\u9759\u6001\u5e93\u8def\u5f84\u4e0e\u4e1a\u52a1\u914d\u7f6e<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6301\u4e45\u5316\u5c42<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4f1a\u8bdd\u3001\u6d88\u606f\u3001\u5ba1\u8ba1\u6570\u636e<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u628a\u7f51\u7edc\u5f02\u5e38\u4f2a\u88c5\u6210\u6210\u529f\u54cd\u5e94<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:8.65pt;margin-right:8.65pt\"><span style=\"background-color:#e8f5f4\">\u5de5\u7a0b\u8fb9\u754c&#xff1a;HTTP \u670d\u52a1\u80fd\u72ec\u7acb\u8dd1\u901a&#xff0c;SDK \u80fd\u72ec\u7acb\u6d4b\u8bd5&#xff0c;CMake \u8d1f\u8d23\u63cf\u8ff0\u5b83\u4eec\u7684\u76ee\u6807\u4f9d\u8d56&#xff0c;\u800c\u4e0d\u662f\u4ee3\u66ff\u4e1a\u52a1\u9002\u914d\u3002<\/span><\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>04\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u9879\u76ee\u76ee\u5f55&#xff5c;\u8ba9\u6e90\u7801\u3001\u914d\u7f6e\u4e0e\u6784\u5efa\u4ea7\u7269\u5404\u5f52\u5176\u4f4d<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"322\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042445-6ae41c0d16e68.jpg\" width=\"629\" \/><\/p>\n<p style=\"text-align:center\">\u56fe 3&#xff5c;\u63a8\u8350\u7684\u5de5\u7a0b\u76ee\u5f55\u7ed3\u6784\u53ca\u6a21\u5757\u804c\u8d23<\/p>\n<p>\u6e90\u4ee3\u7801\u548c\u7f16\u8bd1\u8f93\u51fa\u6df7\u5728\u540c\u4e00\u76ee\u5f55&#xff0c;\u5bb9\u6613\u5bfc\u81f4\u4e34\u65f6\u6587\u4ef6\u3001\u7f13\u5b58\u8def\u5f84\u3001\u65e7 ABI \u4ea7\u7269\u88ab\u8bef\u63d0\u4ea4\u3002\u4f7f\u7528 out-of-source build \u53ef\u8ba9 Debug\u3001Release\u3001\u4e0d\u540c\u7f16\u8bd1\u5668\u5206\u522b\u6709\u81ea\u5df1\u7684\u6784\u5efa\u6811\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u6700\u5c0f\u793a\u4f8b\u91c7\u7528\u4e0b\u5217\u6587\u4ef6<\/h3>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">ChatServer\/<br \/>\n\u251c\u2500\u2500 CMakeLists.txt\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # \u5b9a\u4e49\u76ee\u6807\u4e0e\u4f9d\u8d56<br \/>\n\u251c\u2500\u2500 CMakePresets.json\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # \u53ef\u590d\u7528\u7684\u914d\u7f6e\u53c2\u6570<br \/>\n\u251c\u2500\u2500 src\/<br \/>\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 main.cpp\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # HTTP \u670d\u52a1\u4e0e\u6700\u5c0f\u6a21\u578b\u7f51\u5173<br \/>\n\u251c\u2500\u2500 cmake\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # \u53ef\u9009\u7684\u6269\u5c55\u67e5\u627e\u811a\u672c<br \/>\n\u2514\u2500\u2500 build\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # \u81ea\u52a8\u751f\u6210&#xff0c;\u4e0d\u63d0\u4ea4<\/span><\/p>\n<p>\u8fd9\u91cc\u5148\u4f7f\u7528\u5355\u4e2a main.cpp \u5c55\u793a\u5b8c\u6574\u670d\u52a1\u95ed\u73af&#xff0c;\u65b9\u4fbf\u8bfb\u8005\u76f4\u63a5\u590d\u5236\u3002\u89c4\u6a21\u6269\u5927\u540e&#xff0c;\u518d\u6309 Router\u3001Service\u3001SdkAdapter\u3001Storage \u8fdb\u884c\u62c6\u5206&#xff1b;\u62c6\u5206\u4e0d\u4f1a\u6539\u53d8\u672c\u6587\u7684\u6838\u5fc3 CMake \u4f9d\u8d56\u8bbe\u8ba1\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>05\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u73af\u5883\u51c6\u5907&#xff5c;\u5148\u628a\u4f9d\u8d56\u4e0e\u7248\u672c\u8fb9\u754c\u8bf4\u6e05\u695a<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"317\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042445-6ae41c0d34d16.jpg\" width=\"619\" \/><\/p>\n<p style=\"text-align:center\">\u56fe 4&#xff5c;\u53ef\u6267\u884c\u76ee\u6807\u4e0e\u7b2c\u4e09\u65b9\u5e93\u4e4b\u95f4\u7684\u663e\u5f0f\u4f9d\u8d56\u5173\u7cfb<\/p>\n<table align=\"center\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u7ec4\u4ef6<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u793a\u4f8b\u7ea6\u675f<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u63a5\u5165\u65b9\u5f0f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">CMake<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">3.20 \u53ca\u4ee5\u4e0a<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4f7f\u7528\u76ee\u6807\u5f0f CMake \u548c Preset<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">C&#043;&#043; \u7f16\u8bd1\u5668<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u652f\u6301 C&#043;&#043;17<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">GCC \/ Clang \/ MSVC<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">cpp-httplib<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5177\u5907 OpenSSL \u7ec4\u4ef6<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">httplib::httplib<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">nlohmann\/json<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u63d0\u4f9b CMake \u914d\u7f6e<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">nlohmann_json::nlohmann_json<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">Threads<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5e73\u53f0\u7ebf\u7a0b\u652f\u6301<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">Threads::Threads<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u81ea\u7814 ChatSDK<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u53ef\u9009&#xff1b;\u987b\u6709\u5934\u6587\u4ef6\u548c\u7f16\u8bd1\u4ea7\u7269<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">ChatSDK::ChatSDK<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u4f9d\u8d56\u5b89\u88c5\u65b9\u5f0f\u53ef\u4ee5\u4e0d\u540c&#xff0c;CMake \u76ee\u6807\u540d\u5e94\u5f53\u7a33\u5b9a<\/h3>\n<p>\u5728\u5305\u7ba1\u7406\u5668\u5df2\u5b89\u88c5 httplib&#xff08;\u5e76\u542f\u7528 OpenSSL \u652f\u6301&#xff09;\u548c nlohmann-json \u7684\u524d\u63d0\u4e0b&#xff0c;find_package \u4f1a\u627e\u5230\u5b83\u4eec\u5bfc\u51fa\u7684\u76ee\u6807\u3002\u4f7f\u7528 vcpkg \u65f6&#xff0c;\u9700\u8981\u5728\u9996\u6b21\u914d\u7f6e\u65f6\u6307\u5b9a\u5bf9\u5e94\u7684 CMAKE_TOOLCHAIN_FILE&#xff1b;\u4f7f\u7528\u7cfb\u7edf\u5305\u65f6&#xff0c;\u8981\u786e\u8ba4\u5b89\u88c5\u7684\u7248\u672c\u5305\u542b CMake package config\u3002<\/p>\n<p>\u6ce8\u610f&#xff1a;cpp-httplib \u662f\u963b\u585e\u5f0f HTTP\/1.1 \u7ec4\u4ef6&#xff1b;\u672c\u4f8b\u9762\u5411\u7406\u89e3\u6784\u5efa\u94fe\u8def\u7684\u8f7b\u91cf\u670d\u52a1&#xff0c;\u4e0d\u76f4\u63a5\u7b49\u540c\u4e8e\u9ad8\u5e76\u53d1\u751f\u4ea7\u7f51\u5173\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>06\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u5b8c\u6574 CMakeLists.txt&#xff08;\u4e0a&#xff09;&#xff5c;\u76ee\u6807\u3001\u4f9d\u8d56\u4e0e\u7f16\u8bd1\u7ea6\u675f<\/h2>\n<p>\u4e0b\u9762\u4e24\u9875\u4ee3\u7801\u9700\u8fde\u7eed\u653e\u5165\u9879\u76ee\u6839\u76ee\u5f55\u7684\u540c\u4e00\u4e2a CMakeLists.txt\u3002\u57fa\u7840\u6a21\u5f0f\u65e0\u9700\u81ea\u7814 SDK&#xff1b;\u5f00\u542f CHATSERVER_WITH_SDK \u540e\u624d\u4f1a\u67e5\u627e\u5e76\u94fe\u63a5\u9759\u6001\u5e93\u3002<\/p>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">cmake_minimum_required(VERSION 3.20)<br \/>\nproject(ChatServer VERSION 1.0.0 LANGUAGES CXX)<\/p>\n<p>include(GNUInstallDirs)<br \/>\ninclude(CTest)<\/p>\n<p>option(CHATSERVER_WITH_SDK &#034;Link local ChatSDK&#034; OFF)<br \/>\noption(CHATSERVER_WARNINGS &#034;Enable compiler warnings&#034; ON)<\/p>\n<p>find_package(Threads REQUIRED)<br \/>\nfind_package(nlohmann_json CONFIG REQUIRED)<br \/>\nfind_package(httplib CONFIG REQUIRED COMPONENTS OpenSSL)<\/p>\n<p>add_executable(ChatServer src\/main.cpp)<br \/>\ntarget_compile_features(ChatServer PRIVATE cxx_std_17)<\/p>\n<p>target_link_libraries(ChatServer PRIVATE<br \/>\n\u00a0\u00a0\u00a0 httplib::httplib<br \/>\n\u00a0\u00a0\u00a0 nlohmann_json::nlohmann_json<br \/>\n\u00a0\u00a0\u00a0 Threads::Threads<br \/>\n)<\/p>\n<p>target_compile_definitions(ChatServer PRIVATE<br \/>\n\u00a0\u00a0\u00a0 CHATSERVER_VERSION&#061;&#034;${PROJECT_VERSION}&#034;<br \/>\n)<\/p>\n<p>if(CHATSERVER_WARNINGS)<br \/>\n\u00a0\u00a0\u00a0 if(MSVC)<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 target_compile_options(ChatServer PRIVATE \/W4)<br \/>\n\u00a0\u00a0\u00a0 else()<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 target_compile_options(ChatServer PRIVATE<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -Wall -Wextra -Wpedantic)<br \/>\n\u00a0\u00a0\u00a0 endif()<br \/>\nendif()<\/span><\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u8fd9\u90e8\u5206\u5230\u5e95\u505a\u4e86\u4ec0\u4e48<\/h3>\n<p>\u6838\u5fc3\u662f\u5148\u521b\u5efa ChatServer \u76ee\u6807&#xff0c;\u518d\u628a\u4f9d\u8d56\u7ed1\u5b9a\u7ed9\u8be5\u76ee\u6807&#xff1b;\u7ec4\u4ef6\u7684\u5934\u6587\u4ef6\u76ee\u5f55\u3001\u94fe\u63a5\u4fe1\u606f\u548c\u5fc5\u8981\u7f16\u8bd1\u5b9a\u4e49\u901a\u8fc7\u5bfc\u5165\u76ee\u6807\u4f20\u9012\u3002\u65e0\u9700\u63d0\u524d\u8bbe\u7f6e\u5168\u5c40 include_directories \u6216 link_directories\u3002<\/p>\n<p>find_package(&#8230; COMPONENTS OpenSSL) \u4f9d\u8d56 httplib \u5b89\u88c5\u5305\u63d0\u4f9b\u5bf9\u5e94\u7ec4\u4ef6&#xff1b;\u82e5\u6784\u5efa\u5305\u672a\u542f\u7528 HTTPS&#xff0c;\u5e94\u91cd\u65b0\u5b89\u88c5\u5177\u5907 TLS \u652f\u6301\u7684\u7248\u672c\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>07\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u5b8c\u6574 CMakeLists.txt&#xff08;\u4e0b&#xff09;&#xff5c;\u5bfc\u5165\u81ea\u7814 SDK \u4e0e\u6d4b\u8bd5\u5b89\u88c5<\/h2>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">set(CHATSDK_ROOT &#034;&#034; CACHE PATH &#034;ChatSDK install prefix&#034;)<\/p>\n<p>if(CHATSERVER_WITH_SDK)<br \/>\n\u00a0\u00a0\u00a0 find_path(CHATSDK_INCLUDE_DIR<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAMES ai_chat_sdk\/ChatSDK.h<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HINTS &#034;${CHATSDK_ROOT}&#034;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PATH_SUFFIXES include<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 REQUIRED<br \/>\n\u00a0\u00a0\u00a0 )<br \/>\n\u00a0\u00a0\u00a0 find_library(CHATSDK_LIBRARY<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAMES ai_chat_sdk<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HINTS &#034;${CHATSDK_ROOT}&#034;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PATH_SUFFIXES lib lib64<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 REQUIRED<br \/>\n\u00a0\u00a0\u00a0 )<\/p>\n<p>\u00a0\u00a0\u00a0 add_library(ChatSDK::ChatSDK UNKNOWN IMPORTED)<br \/>\n\u00a0\u00a0\u00a0 set_target_properties(ChatSDK::ChatSDK PROPERTIES<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IMPORTED_LOCATION &#034;${CHATSDK_LIBRARY}&#034;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 INTERFACE_INCLUDE_DIRECTORIES &#034;${CHATSDK_INCLUDE_DIR}&#034;<br \/>\n\u00a0\u00a0\u00a0 )<br \/>\n\u00a0\u00a0\u00a0 target_link_libraries(ChatServer<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PRIVATE ChatSDK::ChatSDK)<br \/>\n\u00a0\u00a0\u00a0 target_compile_definitions(ChatServer<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PRIVATE CHATSERVER_WITH_SDK&#061;1)<br \/>\nendif()<\/p>\n<p>set_target_properties(ChatServer PROPERTIES<br \/>\n\u00a0\u00a0\u00a0 RUNTIME_OUTPUT_DIRECTORY &#034;${CMAKE_BINARY_DIR}\/bin&#034;<br \/>\n)<\/p>\n<p>if(BUILD_TESTING)<br \/>\n\u00a0\u00a0\u00a0 add_test(NAME chatserver_selftest<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 COMMAND $&lt;TARGET_FILE:ChatServer&gt; &#8211;self-test)<br \/>\nendif()<\/p>\n<p>install(TARGETS ChatServer<br \/>\n\u00a0\u00a0\u00a0 RUNTIME DESTINATION &#034;${CMAKE_INSTALL_BINDIR}&#034;)<\/span><\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u4fee\u6539\u70b9\u5fc5\u987b\u770b\u6e05\u695a<\/h3>\n<p>\u793a\u4f8b\u5047\u8bbe SDK \u5934\u6587\u4ef6\u540d\u4e3a ai_chat_sdk\/ChatSDK.h\u3001\u5e93\u540d\u4e3a libai_chat_sdk.a&#xff08;\u6216\u5e73\u53f0\u5bf9\u5e94\u5f62\u5f0f&#xff09;&#xff1b;\u771f\u5b9e SDK \u4e0d\u540c&#xff0c;\u5c31\u8c03\u6574 NAMES \u4e0e\u8def\u5f84\u3002\u5bfc\u5165\u76ee\u6807\u8d1f\u8d23\u94fe\u63a5\u800c\u975e\u81ea\u52a8\u8c03\u7528\u4e1a\u52a1 API&#xff1b;SDK \u82e5\u53e6\u4f9d\u8d56 OpenSSL\u3001SQLite\u3001fmt \u7b49&#xff0c;\u4ecd\u5e94\u7531\u5176\u5bfc\u51fa\u76ee\u6807\u663e\u5f0f\u63cf\u8ff0\u4f20\u9012\u4f9d\u8d56\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>08\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u81ea\u7814\u9759\u6001\u5e93\u63a5\u5165&#xff5c;\u4e3a\u4ec0\u4e48\u8981\u91c7\u7528 IMPORTED Target&#xff1f;<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"317\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042445-6ae41c0d52bf0.jpg\" width=\"619\" \/><\/p>\n<p style=\"text-align:center\">\u56fe 5&#xff5c;SDK \u5b89\u88c5\u524d\u7f00\u3001\u5934\u6587\u4ef6\u3001\u5e93\u6587\u4ef6\u4e0e\u5bfc\u5165\u76ee\u6807\u7684\u5173\u7cfb<\/p>\n<p>\u76f4\u63a5\u5199 link_directories(\/usr\/local\/lib) \u7136\u540e\u5728 target_link_libraries \u4e2d\u586b ai_chat_sdk&#xff0c;\u53ef\u4ee5\u5728\u7279\u5b9a\u673a\u5668\u4e0a\u5de5\u4f5c&#xff0c;\u4f46\u8fd9\u79cd\u5199\u6cd5\u628a\u641c\u7d22\u8def\u5f84\u653e\u5728\u4e86\u8f83\u5bbd\u7684\u4f5c\u7528\u57df\u4e2d&#xff0c;\u4e5f\u96be\u4ee5\u6e05\u695a\u8868\u8fbe\u8be5\u5e93\u7684\u5934\u6587\u4ef6\u4f4d\u7f6e\u4e0e\u5176\u4ed6\u4f7f\u7528\u7ea6\u675f\u3002 \u542f\u7528 SDK \u7684\u914d\u7f6e\u793a\u4f8b&#xff1a;cmake -S . -B build-sdk -DCHATSERVER_WITH_SDK&#061;ON -DCHATSDK_ROOT&#061;\/opt\/chatsdk&#xff1b;\u8def\u5f84\u9700\u6309\u5b9e\u9645\u5b89\u88c5\u4f4d\u7f6e\u66ff\u6362\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u66f4\u53ef\u9760\u7684\u5bfc\u5165\u65b9\u5f0f<\/h3>\n<p>\u2022\u00a0 find_path() \u5b9a\u4f4d\u771f\u5b9e\u5934\u6587\u4ef6\u6240\u5728\u7684 include \u6839\u76ee\u5f55&#xff0c;find_library() \u83b7\u53d6\u5b8c\u6574\u5e93\u6587\u4ef6\u8def\u5f84\u3002<\/p>\n<p>\u2022\u00a0 add_library(&#8230; UNKNOWN IMPORTED) \u8868\u793a\u8be5\u5e93\u7531\u5916\u90e8\u63d0\u4f9b&#xff0c;CMake \u4e0d\u8d1f\u8d23\u91cd\u65b0\u6784\u5efa\u5b83\u3002<\/p>\n<p>\u2022\u00a0 IMPORTED_LOCATION \u7ed9\u51fa\u771f\u5b9e\u5e93\u4f4d\u7f6e&#xff1b;INTERFACE_INCLUDE_DIRECTORIES \u8ba9\u4f7f\u7528\u8be5\u76ee\u6807\u7684\u6e90\u7801\u81ea\u52a8\u83b7\u5f97\u5934\u6587\u4ef6\u8def\u5f84\u3002<\/p>\n<p>\u2022\u00a0 \u5982\u679c SDK \u5df2\u7ecf\u63d0\u4f9b ChatSDKConfig.cmake \u548c ChatSDK::ChatSDK&#xff0c;\u4f18\u5148 find_package(ChatSDK CONFIG REQUIRED)&#xff0c;\u4e0d\u5fc5\u518d\u6b21\u624b\u5199\u5bfc\u5165\u76ee\u6807\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u5207\u52ff\u628a ABI \u95ee\u9898\u7b80\u5316\u4e3a\u201cDebug \u5fc5\u987b\u5bf9\u5e94 Debug\u201d<\/h3>\n<p>\u7f16\u8bd1\u5668\u3001\u6807\u51c6\u5e93\u5b9e\u73b0\u3001\u76ee\u6807\u67b6\u6784\u3001\u5f02\u5e38\/RTTI \u9009\u9879\u53ca\u8fd0\u884c\u65f6\u5e93\u8bbe\u7f6e\u624d\u662f\u517c\u5bb9\u6027\u6392\u67e5\u7684\u6838\u5fc3\u3002Debug \u4e0e Release \u6df7\u7528\u5728\u67d0\u4e9b\u573a\u666f\u53ef\u4ee5\u94fe\u63a5&#xff0c;\u4f46\u542b\u6709\u4e0d\u540c\u8fd0\u884c\u65f6\u7ea6\u5b9a\u6216 ABI \u7ea6\u675f\u65f6\u4f1a\u5931\u8d25&#xff1b;\u52a1\u5fc5\u4ee5\u5e93\u7684\u5b9e\u9645\u6784\u5efa\u914d\u7f6e\u4e3a\u51c6\u3002<\/p>\n<p>Windows \u5e73\u53f0\u82e5\u5bfc\u5165\u52a8\u6001\u5e93&#xff0c;\u901a\u5e38\u9700\u8981\u540c\u65f6\u8003\u8651 IMPORTED_IMPLIB&#xff08;\u5bfc\u5165\u5e93&#xff09;\u548c IMPORTED_LOCATION&#xff08;\u8fd0\u884c\u65f6 DLL&#xff09;&#xff1b;\u672c\u4f8b\u805a\u7126\u9759\u6001 SDK\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>09\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u94fe\u63a5\u7684\u5173\u952e\u4e0d\u662f\u201c\u591a\u5199\u51e0\u4e2a\u5e93\u201d&#xff0c;\u800c\u662f\u4f9d\u8d56\u4f20\u64ad<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"309\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042445-6ae41c0d70a0e.jpg\" width=\"603\" \/><\/p>\n<p style=\"text-align:center\">\u56fe 6&#xff5c;PRIVATE\u3001PUBLIC\u3001INTERFACE \u7684\u771f\u5b9e\u4f5c\u7528\u8303\u56f4<\/p>\n<p>\u628a\u4f9d\u8d56\u8303\u56f4\u5199\u6e05\u695a\u540e&#xff0c;SDK \u4e0e\u670d\u52a1\u5c42\u62c6\u5206\u4e3a\u4e0d\u540c\u76ee\u6807\u4e5f\u4e0d\u9700\u8981\u5168\u5c40\u76ee\u5f55\u6c61\u67d3\u3002\u5224\u65ad\u89c4\u5219&#xff1a;\u516c\u5171\u5934\u6587\u4ef6\u7684\u4f7f\u7528\u8005\u662f\u5426\u4e5f\u9700\u8981\u8fd9\u9879\u4f9d\u8d56&#xff1f;\u5982\u679c\u9700\u8981&#xff0c;\u624d\u8003\u8651 PUBLIC \/ INTERFACE\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u5c0f\u4f8b\u5b50&#xff1a;\u54ea\u4e9b\u94fe\u63a5\u5e94\u8be5\u4f20\u64ad<\/h3>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">add_library(ChatCore src\/core.cpp)<br \/>\ntarget_link_libraries(ChatCore<br \/>\n\u00a0\u00a0\u00a0 PUBLIC\u00a0 nlohmann_json::nlohmann_json<br \/>\n\u00a0\u00a0\u00a0 PRIVATE httplib::httplib<br \/>\n)<br \/>\nadd_executable(ChatServer src\/main.cpp)<br \/>\ntarget_link_libraries(ChatServer PRIVATE ChatCore)<\/span><\/p>\n<p>\u4e0a\u8ff0\u914d\u7f6e\u5047\u5b9a ChatCore \u7684\u516c\u5171\u5934\u6587\u4ef6\u76f4\u63a5\u4f7f\u7528 nlohmann::json \u7c7b\u578b&#xff0c;\u800c httplib \u53ea\u51fa\u73b0\u5728 core.cpp \u5185\u90e8\u3002\u5b9e\u9645\u9879\u76ee\u5e94\u6309\u5934\u6587\u4ef6\u4e0e\u5b9e\u73b0\u7684\u4f9d\u8d56\u4e8b\u5b9e\u9009\u62e9\u4f5c\u7528\u57df&#xff0c;\u4e0d\u8981\u673a\u68b0\u5730\u628a\u6240\u6709\u5e93\u90fd\u6539\u6210 PUBLIC\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u4e09\u4e2a\u5bb9\u6613\u6df7\u6dc6\u7684\u4e8b\u5b9e<\/h3>\n<p>\u2022\u00a0 \u94fe\u63a5\u7684\u9759\u6001\u5e93\u4e0d\u4f1a\u5728\u914d\u7f6e\u65f6\u201c\u81ea\u52a8\u5408\u6210\u201d\u8fdb\u53ef\u6267\u884c\u6587\u4ef6&#xff1b;\u771f\u6b63\u51b3\u5b9a\u7b26\u53f7\u89e3\u6790\u7684\u662f\u6700\u7ec8\u94fe\u63a5\u9636\u6bb5\u3002<\/p>\n<p>\u2022\u00a0 \u5b8c\u6574\u5e93\u8def\u5f84\u6bd4\u4f9d\u9760 -L \u641c\u7d22\u66f4\u5bb9\u6613\u56fa\u5b9a\u6784\u5efa\u7ed3\u679c&#xff0c;\u4f46\u4ecd\u5e94\u5904\u7406\u8be5\u9759\u6001\u5e93\u6240\u4f9d\u8d56\u7684\u5176\u4ed6\u5b9e\u73b0\u3002<\/p>\n<p>\u2022\u00a0 target_link_libraries \u7684 PRIVATE \u662f\u94fe\u63a5\u4f7f\u7528\u8981\u6c42\u7684\u4f20\u64ad\u63a7\u5236&#xff0c;\u4e0d\u662f\u8bbf\u95ee\u63a7\u5236\u6216\u5b89\u5168\u9694\u79bb\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>10\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">Debug \u4e0e Release&#xff5c;\u522b\u628a\u6784\u5efa\u7c7b\u578b\u5199\u6b7b\u5728\u9879\u76ee\u91cc<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"317\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042445-6ae41c0d8e840.jpg\" width=\"619\" \/><\/p>\n<p style=\"text-align:center\">\u56fe 7&#xff5c;\u5355\u914d\u7f6e\u4e0e\u591a\u914d\u7f6e\u751f\u6210\u5668\u7684\u9009\u62e9\u65b9\u5f0f<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u4e24\u5957\u6b63\u786e\u547d\u4ee4<\/h3>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\"># Ninja \/ Unix Makefiles&#xff1a;\u914d\u7f6e\u65f6\u9009\u5b9a Release<br \/>\ncmake -S . -B build-release -G Ninja \\\\<br \/>\n\u00a0 -DCMAKE_BUILD_TYPE&#061;Release<br \/>\ncmake &#8211;build build-release &#8211;parallel<\/p>\n<p># Visual Studio \u7b49\u591a\u914d\u7f6e\u751f\u6210\u5668&#xff1a;\u6784\u5efa\u65f6\u9009\u62e9<br \/>\ncmake -S . -B build-vs<br \/>\ncmake &#8211;build build-vs &#8211;config Release<\/span><\/p>\n<p>\u5f3a\u5236\u5728 CMakeLists.txt \u5199 set(CMAKE_BUILD_TYPE Release) \u4f1a\u8986\u76d6\u8c03\u7528\u8005\u5728\u5355\u914d\u7f6e\u751f\u6210\u5668\u4e2d\u7684\u8c03\u8bd5\u610f\u56fe&#xff0c;\u5bf9\u591a\u914d\u7f6e\u751f\u6210\u5668\u53c8\u4e0d\u8d77\u540c\u6837\u4f5c\u7528\u3002\u66f4\u63a8\u8350\u901a\u8fc7\u547d\u4ee4\u884c\u6216 Preset \u7edf\u4e00\u6784\u5efa\u9009\u62e9\u3002 \u82e5\u9700\u8981\u4fdd\u7559\u4f18\u5316\u4e0e\u8c03\u8bd5\u4fe1\u606f&#xff0c;\u53ef\u53e6\u9009 RelWithDebInfo&#xff0c;\u5e76\u9488\u5bf9\u5b9e\u9645\u5de5\u5177\u94fe\u786e\u8ba4\u751f\u6210\u7684\u7f16\u8bd1\u9009\u9879\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">CMakePresets.json&#xff1a;\u8ba9\u56e2\u961f\u4f7f\u7528\u540c\u4e00\u5957\u914d\u7f6e<\/h3>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">{<br \/>\n\u00a0 &#034;version&#034;: 3,<br \/>\n\u00a0 &#034;configurePresets&#034;: [{<br \/>\n\u00a0\u00a0\u00a0 &#034;name&#034;: &#034;dev&#034;,<br \/>\n\u00a0\u00a0\u00a0 &#034;generator&#034;: &#034;Ninja&#034;,<br \/>\n\u00a0\u00a0\u00a0 &#034;binaryDir&#034;: &#034;${sourceDir}\/build\/dev&#034;,<br \/>\n\u00a0\u00a0\u00a0 &#034;cacheVariables&#034;: {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0 &#034;CMAKE_BUILD_TYPE&#034;: &#034;Debug&#034;<br \/>\n\u00a0\u00a0\u00a0 }<br \/>\n\u00a0 }]<br \/>\n}<\/span><\/p>\n<p>\u6b64\u5904 Preset \u662f\u53ef\u590d\u5236\u7684\u6700\u5c0f\u8303\u4f8b&#xff1b;\u6b63\u5f0f\u9879\u76ee\u53ef\u518d\u52a0\u5165 Release\u3001\u5de5\u5177\u94fe\u8def\u5f84\u548c\u6d4b\u8bd5\u9884\u8bbe\u3002\u7f13\u5b58\u4e2d\u4e0d\u8981\u5199 API \u5bc6\u94a5\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>11\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u6700\u5c0f\u53ef\u8fd0\u884c ChatServer&#xff5c;main.cpp&#xff08;\u4e0a&#xff09;<\/h2>\n<p>\u4ee5\u4e0b\u4ee3\u7801\u4fdd\u5b58\u4e3a src\/main.cpp\u3002\u5b83\u4f7f\u7528 cpp-httplib \u63a5\u6536 HTTP&#xff0c;\u4f7f\u7528 nlohmann\/json \u5904\u7406 JSON\u3002\u6f14\u793a\u6a21\u5f0f\u4e0d\u4f1a\u8bbf\u95ee\u5916\u90e8\u670d\u52a1&#xff1b;\u8fdc\u7aef\u6a21\u5f0f\u4f7f\u7528 HTTPS \u4e0e\u4e00\u4e2a\u517c\u5bb9 \/v1\/chat\/completions \u7684\u6a21\u578b\u7aef\u70b9\u4ea4\u4e92\u3002<\/p>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">#include &lt;cstdlib&gt;<br \/>\n#include &lt;exception&gt;<br \/>\n#include &lt;iostream&gt;<br \/>\n#include &lt;stdexcept&gt;<br \/>\n#include &lt;string&gt;<br \/>\n#include &lt;httplib.h&gt;<br \/>\n#include &lt;nlohmann\/json.hpp&gt;<\/p>\n<p>using json &#061; nlohmann::json;<\/p>\n<p>namespace {<br \/>\nstd::string env(const char* name) {<br \/>\n\u00a0\u00a0\u00a0 const char* v &#061; std::getenv(name);<br \/>\n\u00a0\u00a0\u00a0 return v ? std::string(v) : std::string{};<br \/>\n}<\/p>\n<p>void output(httplib::Response&amp; res,<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int status, const json&amp; data) {<br \/>\n\u00a0\u00a0\u00a0 res.status &#061; status;<br \/>\n\u00a0\u00a0\u00a0 res.set_content(data.dump(),<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#034;application\/json; charset&#061;utf-8&#034;);<br \/>\n}<\/p>\n<p>bool valid_prompt(const json&amp; obj) {<br \/>\n\u00a0\u00a0\u00a0 return obj.is_object()<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; obj.contains(&#034;prompt&#034;)<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; obj[&#034;prompt&#034;].is_string()<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &amp;&amp; !obj[&#034;prompt&#034;].get&lt;std::string&gt;().empty();<br \/>\n}<\/p>\n<p>json complete(const std::string&amp; prompt) {<br \/>\n\u00a0\u00a0\u00a0 if (env(&#034;CHAT_MODE&#034;) &#061;&#061; &#034;mock&#034;) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return {{&#034;mode&#034;, &#034;mock&#034;},<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {&#034;reply&#034;, &#034;[\u6f14\u793a] \u5df2\u6536\u5230&#xff1a;&#034; &#043; prompt}};<br \/>\n\u00a0\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0 const auto base\u00a0 &#061; env(&#034;CHAT_API_BASE&#034;);<br \/>\n\u00a0\u00a0\u00a0 const auto key\u00a0\u00a0 &#061; env(&#034;CHAT_API_KEY&#034;);<br \/>\n\u00a0\u00a0\u00a0 const auto model &#061; env(&#034;CHAT_MODEL&#034;);<br \/>\n\u00a0\u00a0\u00a0 if (base.empty() || key.empty() || model.empty()) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 throw std::invalid_argument(&#034;configuration missing&#034;);<br \/>\n\u00a0\u00a0\u00a0 }<\/span><\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u8fd9\u4e00\u6bb5\u627f\u62c5\u7684\u804c\u8d23<\/h3>\n<p>env() \u8bfb\u53d6\u73af\u5883\u53d8\u91cf&#xff0c;output() \u7edf\u4e00\u8f93\u51fa JSON \u548c HTTP \u72b6\u6001\u7801&#xff0c;valid_prompt() \u5bf9\u8f93\u5165\u4f5c\u6700\u57fa\u672c\u7684\u7ed3\u6784\u6821\u9a8c\u3002\u8c03\u7528\u51fd\u6570 complete() \u4e2d\u7684 mock \u5206\u652f\u7ed9\u51fa\u4e86\u53ef\u672c\u5730\u68c0\u67e5\u7684\u884c\u4e3a&#xff0c;\u4e0d\u80fd\u5c06\u5176\u8bef\u8ba4\u4e3a\u6a21\u578b\u751f\u6210\u7684\u56de\u7b54\u3002<\/p>\n<p>\u6b63\u5f0f\u63a5\u53e3\u5e94\u6269\u5c55\u9274\u6743\u3001\u8bf7\u6c42\u4f53\u5927\u5c0f\u4e0a\u9650\u3001\u7ed3\u6784\u5316\u9519\u8bef\u7801\u548c\u4f1a\u8bdd\u4e0a\u4e0b\u6587&#xff1b;\u672c\u6587\u4ec5\u6f14\u793a\u6784\u5efa\u4e0e\u6700\u5c0f\u670d\u52a1\u95ed\u73af\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>12\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u6700\u5c0f\u53ef\u8fd0\u884c ChatServer&#xff5c;main.cpp&#xff08;\u4e2d&#xff09;<\/h2>\n<p>\u63a5\u7740\u5199\u5728\u4e0a\u4e00\u9875\u7684 complete() \u51fd\u6570\u5185\u90e8\u3002\u6a21\u578b\u5730\u5740\u4ece\u670d\u52a1\u7aef\u73af\u5883\u53d8\u91cf\u8bfb\u53d6&#xff0c;\u4e0d\u5141\u8bb8\u7531 HTTP \u8bf7\u6c42\u53c2\u6570\u968f\u610f\u6307\u5b9a&#xff0c;\u4ee5\u7f29\u5c0f\u4e0d\u53d7\u63a7\u7f51\u7edc\u8bbf\u95ee\u9762\u3002<\/p>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">\u00a0\u00a0\u00a0 if (base.rfind(&#034;https:\/\/&#034;, 0) !&#061; 0) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 throw std::invalid_argument(&#034;HTTPS required&#034;);<br \/>\n\u00a0\u00a0\u00a0 }<br \/>\n\u00a0\u00a0\u00a0 httplib::Client client(base);<br \/>\n\u00a0\u00a0\u00a0 client.set_connection_timeout(5, 0);<br \/>\n\u00a0\u00a0\u00a0 client.set_read_timeout(45, 0);<\/p>\n<p>\u00a0\u00a0\u00a0 httplib::Headers headers &#061; {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {&#034;Authorization&#034;, &#034;Bearer &#034; &#043; key}<br \/>\n\u00a0\u00a0\u00a0 };<br \/>\n\u00a0\u00a0\u00a0 json request &#061; {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {&#034;model&#034;, model},<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {&#034;messages&#034;, json::array({<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {{&#034;role&#034;, &#034;user&#034;}, {&#034;content&#034;, prompt}}<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 })}<br \/>\n\u00a0\u00a0\u00a0 };<\/p>\n<p>\u00a0\u00a0\u00a0 auto response &#061; client.Post(<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#034;\/v1\/chat\/completions&#034;,<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 headers, request.dump(), &#034;application\/json&#034;);<\/p>\n<p>\u00a0\u00a0\u00a0 if (!response || response-&gt;status !&#061; 200) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 throw std::runtime_error(&#034;model endpoint unavailable&#034;);<br \/>\n\u00a0\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0 const auto body &#061; json::parse(response-&gt;body);<br \/>\n\u00a0\u00a0\u00a0 return {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {&#034;mode&#034;, &#034;remote&#034;},<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {&#034;reply&#034;, body.at(&#034;choices&#034;).at(0)<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 .at(&#034;message&#034;).at(&#034;content&#034;)}<br \/>\n\u00a0\u00a0\u00a0 };<br \/>\n}<br \/>\n}\u00a0 \/\/ namespace<\/span><\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u4e94\u4e2a\u5173\u952e\u70b9<\/h3>\n<p>\u2022\u00a0 HTTP \u5ba2\u6237\u7aef\u7684\u57fa\u7840\u5730\u5740\u5e94\u914d\u7f6e\u4e3a\u53d7\u4fe1\u4efb\u7684 https:\/\/ \u4e3b\u673a\u4e0e\u7aef\u53e3&#xff1b;\u8def\u5f84\u56fa\u5b9a\u4e3a\u793a\u4f8b\u517c\u5bb9\u534f\u8bae\u7684 \/v1\/chat\/completions\u3002<\/p>\n<p>\u2022\u00a0 Authorization \u8bf7\u6c42\u5934\u4ec5\u5728\u670d\u52a1\u5668\u5185\u90e8\u7ec4\u88c5&#xff0c;\u7edd\u4e0d\u8fd4\u56de\u7ed9\u8c03\u7528\u65b9&#xff0c;\u4e5f\u4e0d\u6253\u5370\u5230\u666e\u901a\u65e5\u5fd7\u3002<\/p>\n<p>\u2022\u00a0 \u8fde\u63a5\u8d85\u65f6\u4e0e\u8bfb\u53d6\u8d85\u65f6\u4f7f\u7528\u4e0d\u540c\u53c2\u6570&#xff0c;\u907f\u514d\u7f51\u7edc\u957f\u65f6\u95f4\u5361\u4f4f\u8bf7\u6c42\u5904\u7406\u7ebf\u7a0b\u3002<\/p>\n<p>\u2022\u00a0 \u4f7f\u7528 status &#061;&#061; 200 \u4f5c\u4e3a\u672c\u793a\u4f8b\u9884\u671f\u6210\u529f\u6761\u4ef6&#xff1b;\u771f\u5b9e\u573a\u666f\u9700\u8981\u6309\u670d\u52a1\u65b9\u5951\u7ea6\u89e3\u91ca\u5176\u4ed6 2xx\u3001\u9519\u8bef\u4f53\u4e0e\u9650\u6d41\u72b6\u6001\u3002<\/p>\n<p>\u2022\u00a0 JSON \u7ed3\u6784\u89e3\u6790\u5931\u8d25\u4f1a\u629b\u51fa\u5f02\u5e38&#xff0c;\u4e0b\u4e00\u9875\u7531\u8def\u7531\u5c42\u7edf\u4e00\u8f6c\u6362\u4e3a\u7f51\u5173\u9519\u8bef&#xff0c;\u907f\u514d\u6cc4\u9732\u4e0a\u6e38\u54cd\u5e94\u539f\u6587\u3002<\/p>\n<p style=\"margin-left:8.65pt;margin-right:8.65pt\"><span style=\"background-color:#e8f5f4\">\u672c\u6bb5\u7684\u771f\u5b9e\u8c03\u7528\u8def\u5f84\u662f\u57fa\u4e8e HTTP \u7684\u6700\u5c0f\u9002\u914d\u5668\u3002\u5982\u679c\u9879\u76ee\u5df2\u7ecf\u5c01\u88c5\u4e86 ChatSDK&#xff0c;\u5e94\u628a complete() \u7684\u8fdc\u7aef\u5206\u652f\u66ff\u6362\u4e3a SDK \u516c\u6709 API \u8c03\u7528&#xff0c;\u5e76\u4fdd\u7559\u76f8\u540c\u7684\u8f93\u51fa\u5951\u7ea6\u3002<\/span><\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>13\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u6700\u5c0f\u53ef\u8fd0\u884c ChatServer&#xff5c;main.cpp&#xff08;\u4e0b&#xff09;<\/h2>\n<p>\u6700\u540e\u8ffd\u52a0\u7a0b\u5e8f\u5165\u53e3\u3002\u72ec\u7acb\u7684 &#8211;self-test \u7528\u4e8e\u6700\u5c0f\u81ea\u68c0&#xff1b;\/health \u4e0d\u8c03\u7528\u6a21\u578b&#xff1b;\/api\/chat \u6839\u636e\u73af\u5883\u53d8\u91cf\u51b3\u5b9a\u6f14\u793a\u6216\u771f\u5b9e\u8fdc\u7aef\u8bf7\u6c42\u3002<\/p>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">int main(int argc, char** argv) {<br \/>\n\u00a0\u00a0\u00a0 if (argc &gt; 1 &amp;&amp;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 std::string(argv[1]) &#061;&#061; &#034;&#8211;self-test&#034;) {<br \/>\n\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0auto sample &#061; json::parse(R&#034;({&#034;prompt&#034;:&#034;hello&#034;})&#034;);<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return valid_prompt(sample) ? 0 : 1;<br \/>\n\u00a0\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0 httplib::Server server;<br \/>\n\u00a0\u00a0\u00a0 server.set_payload_max_length(16 * 1024);<\/p>\n<p>\u00a0\u00a0\u00a0 server.Get(&#034;\/health&#034;,<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [](const httplib::Request&amp;, httplib::Response&amp; res) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 output(res, 200, {{&#034;status&#034;, &#034;ok&#034;}});<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 });<\/p>\n<p>\u00a0\u00a0\u00a0 server.Post(&#034;\/api\/chat&#034;,<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 [](const httplib::Request&amp; req,<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 httplib::Response&amp; res) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 auto data &#061; json::parse(req.body, nullptr, false);<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0if (!valid_prompt(data)) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 output(res, 400, {{&#034;error&#034;, &#034;invalid_prompt&#034;}});<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 const auto prompt &#061; data[&#034;prompt&#034;].get&lt;std::string&gt;();<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (prompt.size() &gt; 4000) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 output(res, 413, {{&#034;error&#034;, &#034;prompt_too_large&#034;}});<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (env(&#034;CHAT_MODE&#034;) !&#061; &#034;mock&#034; &amp;&amp;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (env(&#034;CHAT_API_BASE&#034;).empty() ||<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 env(&#034;CHAT_API_KEY&#034;).empty() ||<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 env(&#034;CHAT_MODEL&#034;).empty())) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 output(res, 503, {{&#034;error&#034;, &#034;not_configured&#034;}});<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 try {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 output(res, 200, complete(prompt));<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 } catch (const std::exception&amp;) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0output(res, 502, {{&#034;error&#034;, &#034;upstream_failed&#034;}});<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 });<\/p>\n<p>\u00a0\u00a0\u00a0 std::cout &lt;&lt; &#034;http:\/\/127.0.0.1:8080\\\\n&#034;;<br \/>\n\u00a0\u00a0\u00a0 if (!server.listen(&#034;127.0.0.1&#034;, 8080)) {<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 std::cerr &lt;&lt; &#034;listen failed\\\\n&#034;;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return 1;<br \/>\n\u00a0\u00a0\u00a0 }<br \/>\n\u00a0\u00a0\u00a0 return 0;<br \/>\n}<\/span><\/p>\n<p>\u76d1\u542c\u5730\u5740\u56fa\u5b9a\u4e3a 127.0.0.1&#xff0c;\u4fbf\u4e8e\u672c\u5730\u9a8c\u8bc1&#xff1b;\u5982\u9700\u5bf9\u5916\u63d0\u4f9b\u8bbf\u95ee&#xff0c;\u5e94\u7ecf\u53ef\u4fe1\u7684\u53cd\u5411\u4ee3\u7406\u914d\u7f6e TLS\u3001\u9274\u6743\u3001\u9650\u6d41\u53ca\u8bbf\u95ee\u65e5\u5fd7&#xff0c;\u800c\u4e0d\u662f\u76f4\u63a5\u7167\u642c\u6f14\u793a\u914d\u7f6e\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>14\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u63a5\u53e3\u9a8c\u8bc1&#xff5c;\u4ece\u6f14\u793a\u7ed3\u679c\u5230\u771f\u5b9e\u6a21\u578b\u8c03\u7528<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"317\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042445-6ae41c0daccc4.jpg\" width=\"619\" \/><\/p>\n<p style=\"text-align:center\">\u56fe 8&#xff5c;\u8f93\u5165\u6821\u9a8c\u3001\u6f14\u793a\u6a21\u5f0f\u3001\u771f\u5b9e HTTPS \u4e0e\u9519\u8bef\u8fb9\u754c<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u5148\u542f\u52a8\u6f14\u793a\u6a21\u5f0f&#xff0c;\u4e0d\u9700\u8981\u5bc6\u94a5<\/h3>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">cmake -S . -B build -G Ninja \\\\<br \/>\n\u00a0 -DCMAKE_BUILD_TYPE&#061;Debug<br \/>\ncmake &#8211;build build &#8211;parallel<br \/>\nCHAT_MODE&#061;mock .\/build\/bin\/ChatServer<\/span><\/p>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">curl -i http:\/\/127.0.0.1:8080\/health<br \/>\ncurl -i -X POST http:\/\/127.0.0.1:8080\/api\/chat \\\\<br \/>\n\u00a0 -H &#039;Content-Type: application\/json&#039; \\\\<br \/>\n\u00a0 -d &#039;{&#034;prompt&#034;:&#034;\u4f60\u597d&#xff0c;ChatServer&#034;}&#039; <\/span><\/p>\n<p>\u671f\u671b\u7684\u6f14\u793a\u54cd\u5e94\u793a\u610f&#xff1a;{&#034;mode&#034;:&#034;mock&#034;,&#034;reply&#034;:&#034;[\u6f14\u793a] \u5df2\u6536\u5230&#xff1a;\u4f60\u597d&#xff0c;ChatServer&#034;}\u3002\u8fd9\u4e00\u54cd\u5e94\u80fd\u8bc1\u660e HTTP \u63a5\u53e3\u3001JSON \u89e3\u6790\u4e0e\u53ef\u6267\u884c\u7a0b\u5e8f\u5df2\u4e32\u8054&#xff0c;\u4f46\u4e0d\u4ee3\u8868\u53d1\u751f\u4e86\u771f\u5b9e\u63a8\u7406\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u5207\u6362\u5230\u771f\u5b9e\u6a21\u578b\u7aef\u70b9<\/h3>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\">export CHAT_API_BASE&#061;&#034;https:\/\/your-model-host.example&#034;<br \/>\nexport CHAT_MODEL&#061;&#034;your-model-id&#034;<br \/>\nexport CHAT_API_KEY&#061;&#034;\u4ece\u5b89\u5168\u6765\u6e90\u63d0\u4f9b\u7684\u771f\u5b9e\u5bc6\u94a5&#034;<br \/>\nunset CHAT_MODE<br \/>\n.\/build\/bin\/ChatServer<\/span><\/p>\n<p>\u8fd9\u91cc\u7684\u4e3b\u673a\u4e0e\u6a21\u578b\u540d\u662f\u5360\u4f4d\u7b26&#xff0c;\u987b\u6309\u6240\u63a5\u5165\u670d\u52a1\u5b9e\u9645\u6587\u6863\u586b\u5199&#xff1b;\u8fdc\u7aef\u5fc5\u987b\u5b9e\u73b0\u5bf9\u5e94\u517c\u5bb9\u63a5\u53e3\u3002\u5bc6\u94a5\u4e0d\u8981\u63d0\u4ea4\u81f3\u4ed3\u5e93\u3001\u5199\u8fdb CMake \u7f13\u5b58\u6216\u5305\u542b\u5728\u516c\u5f00\u622a\u56fe\u4e2d\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>15\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u6d4b\u8bd5\u4e0d\u6b62\u4e8e curl&#xff5c;\u628a\u57fa\u7840\u81ea\u68c0\u653e\u5165 CTest<\/h2>\n<p>CMakeLists.txt \u4e2d add_test \u5c06\u81ea\u68c0\u7a0b\u5e8f\u6ce8\u518c\u4e3a\u6d4b\u8bd5\u9879\u3002\u8fd9\u6837\u6784\u5efa\u5b8c\u6210\u540e\u4e0d\u5fc5\u4f9d\u8d56\u8bfb\u8005\u624b\u52a8\u6253\u5f00\u7ec8\u7aef\u68c0\u67e5\u7b2c\u4e00\u9053\u95e8\u69db&#xff0c;\u4e5f\u4e3a\u540e\u7eed\u52a0\u5165\u5355\u5143\u6d4b\u8bd5\u3001HTTP \u96c6\u6210\u6d4b\u8bd5\u7559\u51fa\u4e86\u6807\u51c6\u5165\u53e3\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u590d\u73b0\u547d\u4ee4\u4e0e\u68c0\u67e5\u7ef4\u5ea6<\/h3>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\"># \u7f16\u8bd1<br \/>\ncmake &#8211;build build &#8211;parallel<\/p>\n<p># \u8fd0\u884c CTest&#xff1a;\u5931\u8d25\u65f6\u5c55\u5f00\u8be6\u7ec6\u8f93\u51fa<br \/>\nctest &#8211;test-dir build &#8211;output-on-failure<\/p>\n<p># \u5355\u72ec\u6267\u884c\u81ea\u68c0&#xff0c;\u8fd4\u56de\u7801 0 \u4e3a\u901a\u8fc7<br \/>\n.\/build\/bin\/ChatServer &#8211;self-test<\/p>\n<p># \u5b89\u88c5\u5230\u9694\u79bb\u76ee\u5f55&#xff0c;\u68c0\u67e5\u4ea4\u4ed8\u4ea7\u7269<br \/>\ncmake &#8211;install build &#8211;prefix .\/stage<\/span><\/p>\n<table align=\"center\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6d4b\u8bd5\u5c42\u7ea7<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u68c0\u67e5\u5bf9\u8c61<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u63a8\u8350\u6267\u884c\u65f6\u673a<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u914d\u7f6e\u6d4b\u8bd5<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4f9d\u8d56\u662f\u5426\u80fd\u627e\u5230\u3001\u76ee\u6807\u662f\u5426\u751f\u6210<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6bcf\u6b21\u5de5\u5177\u94fe\u6216\u4f9d\u8d56\u53d8\u5316<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5355\u5143\u81ea\u68c0<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">JSON \u4e0e\u53c2\u6570\u6821\u9a8c\u7684\u6700\u5c0f\u884c\u4e3a<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6bcf\u6b21\u4ee3\u7801\u63d0\u4ea4<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">HTTP \u5192\u70df<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\/health \u548c \/api\/chat \u7684\u5951\u7ea6<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u670d\u52a1\u542f\u52a8\u540e<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u96c6\u6210\u6d4b\u8bd5<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u8fdc\u7aef\u8d85\u65f6\u3001\u5f02\u5e38\u7801\u3001\u683c\u5f0f\u53d8\u5316<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6d4b\u8bd5\u73af\u5883\u4e2d<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5b89\u88c5\u9a8c\u8bc1<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">stage\/bin \u4e0e\u8fd0\u884c\u65f6\u4f9d\u8d56<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4ea4\u4ed8\u524d<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u8ba9\u6d4b\u8bd5\u8bb0\u5f55\u80fd\u591f\u89e3\u91ca\u5931\u8d25<\/h3>\n<p>\u5efa\u8bae\u4e3a\u96c6\u6210\u6d4b\u8bd5\u521b\u5efa\u56fa\u5b9a\u7684\u672c\u5730\u66ff\u8eab\u670d\u52a1&#xff0c;\u6a21\u62df 200\u3001400\u3001429\u3001502 \u4e0e\u8d85\u65f6\u3002\u4ec5\u7528\u771f\u5b9e\u8fdc\u7aef\u670d\u52a1\u6d4b\u8bd5\u4f1a\u53d7\u7f51\u7edc\u548c\u914d\u989d\u5f71\u54cd&#xff0c;\u96be\u4ee5\u5feb\u901f\u5224\u65ad\u5931\u8d25\u53d1\u751f\u5728\u54ea\u4e00\u5c42\u3002<\/p>\n<p style=\"margin-left:8.65pt;margin-right:8.65pt\"><span style=\"background-color:#e8f5f4\">\u6ce8\u610f&#xff1a;\u672c\u6587 &#8211;self-test \u53ea\u9a8c\u8bc1\u6700\u5c0f JSON \u53c2\u6570\u5224\u65ad&#xff0c;\u4e0d\u80fd\u66ff\u4ee3\u771f\u5b9e\u7684 HTTP \u96c6\u6210\u6d4b\u8bd5\u6216 SDK \u5355\u5143\u6d4b\u8bd5&#xff1b;\u6d4b\u8bd5\u8986\u76d6\u8303\u56f4\u5e94\u5728\u9879\u76ee\u6269\u5c55\u65f6\u9010\u6b65\u589e\u52a0\u3002<\/span><\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>16\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u914d\u7f6e\u4e0e\u94fe\u63a5\u6545\u969c&#xff5c;\u5148\u770b\u9519\u8bef\u4fe1\u606f&#xff0c;\u518d\u6539\u6784\u5efa\u811a\u672c<\/h2>\n<table align=\"center\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5178\u578b\u75c7\u72b6<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4f18\u5148\u6392\u67e5<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4e0d\u8981\u91c7\u53d6\u7684\u505a\u6cd5<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u627e\u4e0d\u5230 httplibConfig.cmake<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4f9d\u8d56\u662f\u5426\u5df2\u5b89\u88c5\u3001toolchain\u3001CMAKE_PREFIX_PATH<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u968f\u610f\u590d\u5236\u65e7\u7248\u5934\u6587\u4ef6<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u627e\u4e0d\u5230 ChatSDK \u5934\u6587\u4ef6<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">CHATSDK_ROOT\u3001find_path \u7684 NAMES\u3001\u5b9e\u9645\u76ee\u5f55\u5c42\u7ea7<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5168\u5c40\u8ffd\u52a0\u6240\u6709 include \u76ee\u5f55<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">cannot find -lai_chat_sdk<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5b9e\u9645\u5e93\u540d\u3001\u5b8c\u6574\u8def\u5f84\u3001\u67b6\u6784\u4e0e\u6743\u9650<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u53cd\u590d\u6dfb\u52a0 -L \u800c\u4e0d\u68c0\u67e5\u6587\u4ef6<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">undefined reference \/ LNK2019<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u7b26\u53f7\u5b9a\u4e49\u662f\u5426\u5b58\u5728\u3001\u94fe\u63a5\u76ee\u6807\u3001ABI<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u65e0\u4f9d\u636e\u5730\u91cd\u590d\u94fe\u63a5\u51e0\u5341\u4e2a\u5e93<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">multiple definition<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u91cd\u590d\u7f16\u8bd1\u5b9e\u73b0\u3001\u5934\u6587\u4ef6 ODR\u3001\u9759\u6001\u5e93\u91cd\u590d\u5f15\u5165<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u968f\u610f\u5173\u95ed\u94fe\u63a5\u5668\u68c0\u67e5<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">undefined reference to SSL_*<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">TLS \u4f9d\u8d56\u672a\u4f20\u9012\u3001\u5e93\u7248\u672c\u3001\u94fe\u63a5\u6b21\u5e8f<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4ee5\u7981\u7528\u8bc1\u4e66\u6821\u9a8c\u4e3a\u4fee\u590d<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">LNK2038 runtime mismatch<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">MSVC \u8fd0\u884c\u65f6\u9009\u9879\u3001\u4f9d\u8d56\u6784\u5efa\u53c2\u6570<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5ffd\u7565\u68c0\u6d4b\u5e76\u5f3a\u5236\u4ea7\u51fa<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u6700\u6709\u6548\u7684\u4e09\u6761\u8bca\u65ad\u547d\u4ee4<\/h3>\n<p style=\"margin-left:7.2pt;margin-right:4.3pt\"><span style=\"background-color:#f0f5f9\"># \u8f93\u51fa\u5b8c\u6574\u7f16\u8bd1 \/ \u94fe\u63a5\u547d\u4ee4<br \/>\ncmake &#8211;build build &#8211;verbose<\/p>\n<p># \u89c2\u5bdf CMake \u4f9d\u8d56\u67e5\u627e\u8fc7\u7a0b<br \/>\ncmake -S . -B build &#8211;debug-find<\/p>\n<p># \u67e5\u770b\u6784\u5efa\u7f13\u5b58\u4e2d\u7684 SDK \u8def\u5f84<br \/>\ncmake -LAH -N build<\/span><\/p>\n<p>CMake \u7684\u5b9a\u4f4d\u601d\u8def\u662f\u5148\u786e\u8ba4\u201c\u54ea\u4e2a\u76ee\u6807\u9700\u8981\u4ec0\u4e48\u201d&#xff0c;\u518d\u786e\u8ba4\u201c\u5b9e\u9645\u94fe\u63a5\u7684\u662f\u54ea\u4e00\u4e2a\u5e93\u6587\u4ef6\u201d\u3002\u540c\u540d\u5e93\u5b58\u5728\u591a\u4e2a\u76ee\u5f55\u65f6&#xff0c;\u6700\u5371\u9669\u7684\u60c5\u51b5\u4e0d\u662f\u7acb\u5373\u62a5\u9519&#xff0c;\u800c\u662f\u5076\u7136\u9009\u4e2d\u9519\u8bef\u7248\u672c\u540e\u4ea7\u751f\u96be\u4ee5\u5b9a\u4f4d\u7684\u8fd0\u884c\u65f6\u95ee\u9898\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u9759\u6001\u5e93\u987a\u5e8f\u4e0e\u4f20\u9012\u4f9d\u8d56<\/h3>\n<p>\u5728\u67d0\u4e9b\u94fe\u63a5\u5668\u5904\u7406\u9759\u6001\u5f52\u6863\u65f6&#xff0c;\u5e93\u7684\u51fa\u73b0\u987a\u5e8f\u4f1a\u5f71\u54cd\u7b26\u53f7\u89e3\u6790&#xff1b;\u73af\u72b6\u4f9d\u8d56\u5c24\u5176\u660e\u663e\u3002\u4f18\u5148\u91cd\u6784\u76ee\u6807\u4f9d\u8d56\u3001\u6d88\u9664\u5faa\u73af&#xff0c;\u800c\u4e0d\u662f\u53cd\u590d\u8bd5\u63a2\u94fe\u63a5\u5668\u9009\u9879\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>17\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u8fd0\u884c\u65f6\u4e0e\u5b89\u5168\u8fb9\u754c&#xff5c;Release \u4ea4\u4ed8\u5e38\u89c1\u7684\u6700\u540e\u4e00\u9053\u574e<\/h2>\n<table align=\"center\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u95ee\u9898<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u8bc6\u522b\u4fe1\u53f7<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5904\u7406\u65b9\u5411<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5171\u4eab\u5e93\u7f3a\u5931<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">cannot open shared object file \/ DLL not found<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u68c0\u67e5\u8fd0\u884c\u65f6\u641c\u7d22\u8def\u5f84\u4e0e\u6253\u5305<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">TLS \u8bc1\u4e66\u5f02\u5e38<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u8bc1\u4e66\u94fe\u9a8c\u8bc1\u5931\u8d25<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5b89\u88c5\u53ef\u4fe1 CA \u8bc1\u4e66\u3001\u6821\u51c6\u65f6\u95f4<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u7aef\u53e3\u5360\u7528<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">listen failed<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u68c0\u67e5\u5df2\u6709\u8fdb\u7a0b\u4e0e\u7aef\u53e3<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6a21\u578b\u670d\u52a1\u9650\u6d41<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u8fdc\u7aef\u8fd4\u56de 429<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u53d7\u63a7\u91cd\u8bd5\u3001\u9000\u907f\u4e0e\u8bf7\u6c42\u6392\u961f<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u8bf7\u6c42\u8d85\u65f6<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u8fde\u63a5\u6216\u8bfb\u53d6\u8d85\u65f6<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u62c6\u5206\u8d85\u65f6\u7c7b\u578b\u3001\u589e\u52a0\u89c2\u6d4b<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6a21\u578b\u7ed3\u6784\u53d8\u66f4<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">choices \u7b49\u5b57\u6bb5\u7f3a\u5931<\/span><\/p>\n<\/td>\n<td style=\"width:163.45pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u7248\u672c\u5316\u534f\u8bae\u4e0e JSON \u6821\u9a8c<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u56db\u6761\u4e0d\u80fd\u8df3\u8fc7\u7684\u7ea6\u675f<\/h3>\n<p>\u2022\u00a0 \u5bc6\u94a5\u53ea\u653e\u5728\u670d\u52a1\u7aef\u53ef\u63a7\u7684\u73af\u5883\u53d8\u91cf\u6216\u4e13\u7528\u5bc6\u94a5\u7ba1\u7406\u65b9\u6848\u4e2d&#xff1b;\u65e5\u5fd7\u91cc\u53ea\u4fdd\u7559\u5fc5\u8981\u7684\u8bca\u65ad\u5b57\u6bb5\u3002<\/p>\n<p>\u2022\u00a0 \u4fdd\u6301 TLS \u8bc1\u4e66\u6821\u9a8c\u5f00\u542f&#xff1b;\u4e0d\u8981\u4e3a\u4e86\u201c\u4e34\u65f6\u8dd1\u901a\u201d\u628a\u8bc1\u4e66\u5931\u8d25\u6539\u6210\u9759\u9ed8\u63a5\u53d7\u3002<\/p>\n<p>\u2022\u00a0 \u4e25\u683c\u9650\u5236\u8bf7\u6c42\u4f53\u5927\u5c0f\u3001\u8f93\u5165\u7c7b\u578b\u4e0e\u8d85\u65f6&#xff1b;\u5fc5\u8981\u65f6\u589e\u52a0\u8bf7\u6c42\u901f\u7387\u63a7\u5236\u548c\u5e76\u53d1\u4e0a\u9650\u3002<\/p>\n<p>\u2022\u00a0 \u533a\u5206\u4e0a\u6e38\u72b6\u6001\u7801\u4e0e\u5bf9\u5916\u9519\u8bef\u7801&#xff0c;\u907f\u514d\u628a\u4e1a\u52a1\u9519\u8bef\u3001\u9650\u6d41\u3001\u7f51\u7edc\u8d85\u65f6\u5168\u90e8\u4f2a\u88c5\u6210\u6210\u529f\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u6027\u80fd\u9884\u671f\u52a1\u5fc5\u7b26\u5408\u7ec4\u4ef6\u7279\u6027<\/h3>\n<p>cpp-httplib \u91c7\u7528\u963b\u585e\u5f0f I\/O\u3002\u672c\u4f8b\u5bf9\u6bcf\u6b21\u804a\u5929\u8bf7\u6c42\u540c\u6b65\u7b49\u5f85\u8fdc\u7aef\u7ed3\u679c&#xff0c;\u9002\u5408\u5b66\u4e60\u3001\u9a8c\u8bc1\u4e0e\u8f7b\u91cf\u670d\u52a1\u3002\u957f\u65f6\u95f4\u63a8\u7406\u3001\u9ad8\u5e76\u53d1\u6216\u6d41\u5f0f\u8fd4\u56de\u573a\u666f\u5e94\u989d\u5916\u8bbe\u8ba1\u5f02\u6b65\u4efb\u52a1\u8c03\u5ea6\u3001\u80cc\u538b\u3001\u53d6\u6d88\u3001SSE \u751f\u547d\u5468\u671f\u4e0e\u8fde\u63a5\u6570\u7ba1\u7406&#xff0c;\u800c\u4e0d\u662f\u4ec5\u8c03\u9ad8\u7f16\u8bd1\u4f18\u5316\u7b49\u7ea7\u3002<\/p>\n<p>Release \u4f18\u5316\u53ef\u4ee5\u6539\u5584\u90e8\u5206 CPU \u5f00\u9500&#xff0c;\u4f46\u4e0d\u4fdd\u8bc1\u7f51\u7edc\u5ef6\u8fdf\u6216\u6a21\u578b\u63a8\u7406\u8017\u65f6\u4e0b\u964d&#xff1b;\u6027\u80fd\u7ed3\u8bba\u5fc5\u987b\u7528\u76f8\u540c\u8bf7\u6c42\u3001\u8d1f\u8f7d\u4e0e\u73af\u5883\u505a\u57fa\u51c6\u6d4b\u8bd5\u3002<\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>18\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u6545\u969c\u5b9a\u4f4d\u51b3\u7b56\u6811&#xff5c;\u5341\u5206\u949f\u68b3\u7406\u4e00\u6b21\u5931\u8d25\u7684\u6784\u5efa<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"317\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042445-6ae41c0dcaae2.jpg\" width=\"619\" \/><\/p>\n<p style=\"text-align:center\">\u56fe 9&#xff5c;\u914d\u7f6e\u3001\u7f16\u8bd1\u3001\u94fe\u63a5\u4e0e\u8fd0\u884c\u9636\u6bb5\u7684\u5206\u5c42\u6392\u9519\u601d\u8def<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u6309\u987a\u5e8f\u505a&#xff0c;\u4e0d\u8981\u540c\u65f6\u4fee\u6539\u5341\u4e2a\u53d8\u91cf<\/h3>\n<p>01&#xff5c;\u786e\u8ba4\u6267\u884c\u7684 CMake \u4e0e\u7f16\u8bd1\u5668\u7248\u672c&#xff0c;\u6e05\u695a\u5f53\u524d\u751f\u6210\u5668\u662f Ninja \u8fd8\u662f Visual Studio\u300202&#xff5c;\u786e\u8ba4\u6e90\u7801\u6811\u548c\u6784\u5efa\u6811\u7684\u7edd\u5bf9\u8def\u5f84&#xff0c;\u907f\u514d\u628a\u591a\u4e2a\u5386\u53f2\u7f13\u5b58\u6df7\u7528\u300203&#xff5c;\u67e5\u770b\u7b2c\u4e00\u4e2a\u5b8c\u6574\u9519\u8bef&#xff0c;\u800c\u4e0d\u662f\u53ea\u770b\u672b\u5c3e\u7684\u201c\u6784\u5efa\u5931\u8d25\u201d\u3002<\/p>\n<p>04&#xff5c;\u82e5\u662f\u914d\u7f6e\u9519\u8bef&#xff0c;\u68c0\u67e5\u4f9d\u8d56\u5305\u63d0\u4f9b\u7684\u76ee\u6807\u540d\u548c\u914d\u7f6e\u6587\u4ef6\u300205&#xff5c;\u82e5\u662f\u7f16\u8bd1\u9519\u8bef&#xff0c;\u68c0\u67e5\u5177\u4f53\u6e90\u6587\u4ef6\u7684\u5305\u542b\u8def\u5f84\u4e0e\u5b8f\u300206&#xff5c;\u82e5\u662f\u94fe\u63a5\u9519\u8bef&#xff0c;\u67e5\u770b\u5b8c\u6574\u94fe\u63a5\u547d\u4ee4\u4e0e\u81ea\u7814\u5e93\u5b9e\u9645\u4f4d\u7f6e\u300207&#xff5c;\u82e5\u662f\u8fd0\u884c\u9519\u8bef&#xff0c;\u68c0\u67e5\u52a8\u6001\u5e93\u52a0\u8f7d\u3001\u73af\u5883\u53d8\u91cf\u3001\u7aef\u53e3\u3001\u8bc1\u4e66\u4e0e\u8fdc\u7aef\u54cd\u5e94\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u54ea\u4e9b\u60c5\u51b5\u4e0b\u5e94\u8be5\u91cd\u5efa\u6784\u5efa\u76ee\u5f55<\/h3>\n<p>\u5207\u6362\u7f16\u8bd1\u5668\u3001\u76ee\u6807\u67b6\u6784\u3001\u5de5\u5177\u94fe\u6216\u4f9d\u8d56\u5b89\u88c5\u524d\u7f00\u540e&#xff0c;\u5efa\u8bae\u521b\u5efa\u65b0\u7684 build \u5b50\u76ee\u5f55&#xff1b;\u65e0\u6cd5\u89e3\u91ca\u7684\u7f13\u5b58\u6c61\u67d3\u4e5f\u53ef\u901a\u8fc7\u5220\u9664\u72ec\u7acb\u6784\u5efa\u6811\u91cd\u65b0\u914d\u7f6e\u3002\u4ec5\u4fee\u6539\u666e\u901a .cpp \u65f6\u901a\u5e38\u65e0\u9700\u6e05\u7a7a\u6574\u4e2a\u7f13\u5b58\u3002<\/p>\n<p style=\"margin-left:8.65pt;margin-right:8.65pt\"><span style=\"background-color:#e8f5f4\">\u6838\u5fc3\u539f\u5219&#xff1a;\u6bcf\u4e00\u6b21\u4fee\u590d\u53ea\u6539\u53d8\u4e00\u4e2a\u53ef\u89e3\u91ca\u7684\u56e0\u7d20&#xff0c;\u5e76\u4fdd\u7559\u590d\u73b0\u547d\u4ee4\u4e0e\u9519\u8bef\u8f93\u51fa\u3002\u53ef\u8ffd\u6eaf\u7684\u4fee\u590d&#xff0c;\u6bd4\u78b0\u5de7\u7f16\u8bd1\u8fc7\u53bb\u66f4\u6709\u4ef7\u503c\u3002<\/span><\/p>\n<p>\u00a0\n<\/p>\n<\/p>\n<p>19\u00a0\u00a0 \/\u00a0\u00a0 CHATSERVER \u6784\u5efa\u4e13\u9898<\/p>\n<h2 style=\"margin-left:0cm;margin-right:0cm\">\u4ece\u201c\u53ef\u8fd0\u884c\u201d\u8d70\u5411\u201c\u53ef\u7ef4\u62a4\u201d&#xff1a;\u4ea4\u4ed8\u6e05\u5355\u4e0e\u8d44\u6599\u7d22\u5f15<\/h2>\n<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"317\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042445-6ae41c0de8c0a.jpg\" width=\"619\" \/><\/p>\n<p style=\"text-align:center\">\u56fe 10&#xff5c;\u4f9d\u8d56\u56fa\u5b9a\u3001\u6784\u5efa\u7559\u75d5\u3001\u6d4b\u8bd5\u3001\u5b89\u5168\u4e0e\u5b89\u88c5\u7ec4\u6210\u95ed\u73af<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u4ea4\u4ed8\u524d\u7684\u5feb\u901f\u6838\u5bf9<\/h3>\n<table align=\"center\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u68c0\u67e5\u9879<\/span><\/p>\n<\/td>\n<td style=\"width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5b8c\u6210\u6807\u51c6<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u76ee\u5f55\u4e0e\u76ee\u6807<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6e90\u7801\u6574\u6d01&#xff1b;\u4f9d\u8d56\u7528\u76ee\u6807\u8868\u8fbe&#xff1b;\u65e0\u9690\u5f0f\u5168\u5c40\u8def\u5f84<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u6784\u5efa\u914d\u7f6e<\/span><\/p>\n<\/td>\n<td style=\"width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">Debug\/Release \u5206\u79bb&#xff1b;\u7f16\u8bd1\u5668\u4e0e\u4f9d\u8d56\u53ef\u8ffd\u6eaf<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">SDK \u63a5\u5165<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5934\u6587\u4ef6\u3001\u5e93\u6587\u4ef6\u3001ABI \u4e0e\u4e1a\u52a1\u9002\u914d\u5df2\u6838\u5bf9<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u670d\u52a1\u9a8c\u8bc1<\/span><\/p>\n<\/td>\n<td style=\"width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">health\u3001\u5f02\u5e38\u8f93\u5165\u3001\u6f14\u793a\u4e0e\u771f\u5b9e\u6a21\u5f0f\u5206\u522b\u68c0\u67e5<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color:#d3dfee;width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u8fd0\u884c\u5b89\u5168<\/span><\/p>\n<\/td>\n<td style=\"background-color:#d3dfee;width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5bc6\u94a5\u4e0d\u5165\u5e93&#xff1b;TLS \u9a8c\u8bc1\u5f00\u542f&#xff1b;\u8d85\u65f6\u4e0e\u65e5\u5fd7\u8fb9\u754c\u660e\u786e<\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u4ea4\u4ed8\u4ea7\u7269<\/span><\/p>\n<\/td>\n<td style=\"width:245.15pt\">\n<p style=\"margin-left:0cm;margin-right:0cm\"><span style=\"color:#365f91\">\u5b89\u88c5\u8def\u5f84\u6e05\u695a&#xff0c;\u8fd0\u884c\u6240\u9700\u7684\u52a8\u6001\u4f9d\u8d56\u9f50\u5907<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e00\u4e2a\u7a33\u5b9a\u7684 ChatServer \u9879\u76ee&#xff0c;\u4e0d\u662f CMakeLists.txt \u5806\u79ef\u4e86\u591a\u5c11\u6307\u4ee4&#xff0c;\u800c\u662f\u6bcf\u6761\u4f9d\u8d56\u90fd\u80fd\u8bf4\u660e\u6765\u5386\u3001\u6bcf\u7c7b\u9519\u8bef\u90fd\u80fd\u5b9a\u4f4d\u9636\u6bb5\u3001\u6bcf\u6b21\u4ea4\u4ed8\u90fd\u80fd\u7531\u522b\u4eba\u590d\u73b0\u3002\u5148\u5efa\u7acb\u53ef\u9760\u7684\u6700\u5c0f\u6784\u5efa\u95ed\u73af&#xff0c;\u518d\u5faa\u5e8f\u52a0\u5165\u4f1a\u8bdd\u7ba1\u7406\u3001\u6d41\u5f0f\u54cd\u5e94\u3001\u6301\u4e45\u5316\u4e0e\u591a\u6a21\u578b\u9002\u914d&#xff0c;\u5de5\u7a0b\u590d\u6742\u5ea6\u624d\u4f1a\u4fdd\u6301\u53ef\u63a7\u3002<\/p>\n<h3 style=\"margin-left:0cm;margin-right:0cm\">\u5ef6\u4f38\u9605\u8bfb&#xff5c;\u5b98\u65b9\u6280\u672f\u8d44\u6599<\/h3>\n<p>CMake target_link_libraries&#xff1a;https:\/\/cmake.org\/cmake\/help\/latest\/command\/target_link_libraries.html<\/p>\n<p>CMake link_directories&#xff1a;https:\/\/cmake.org\/cmake\/help\/latest\/command\/link_directories.html<\/p>\n<p>CMake Build Configurations&#xff1a;https:\/\/cmake.org\/cmake\/help\/latest\/guide\/tutorial\/Before%20You%20Begin.html<\/p>\n<p>cpp-httplib&#xff1a;https:\/\/github.com\/yhirose\/cpp-httplib<\/p>\n<p>nlohmann\/json&#xff1a;https:\/\/github.com\/nlohmann\/json<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>C17\u00a0 \u00b7\u00a0 CMake 3.20\u00a0 \u00b7\u00a0 HTTP\/HTTPS\u00a0 \u00b7\u00a0 \u9759\u6001\u5e93\u96c6\u6210\u00a0 \u00b7\u00a0 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8AI\u5927\u6a21\u578bSDK\u5b9e\u6218&#xff5c;ChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c\u5b9a\u4f4d#C\u00a0 #CMake\u00a0 #CMakeLists.txt\u00a0 #ChatServer\u00a0 #AI\u5927\u6a21\u578b\u00a0 #SDK\u5f00\u53d1\u00a0 #HTTP\u670d\u52a1\u5668\u00a0 #\u9759\u6001\u5e93\u94fe\u63a5\u00a0 #Linux\u00a0 #\u5de5\u7a0b\u5316ChatServer \u4e3a\u4ec0\u4e48\u5728\u5f00\u53d1\u673a\u4e0a\u80fd\u7f16\u8bd1&#xff0c;\u6362\u4e2a\u73af\u5883\u5374\u627e\u4e0d\u5230\u5934\u6587\u4ef6\u3001\u9759\u6001\u5e93\u6216\u8fd0\u884c<\/p>\n","protected":false},"author":2,"featured_media":119780,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13178,99,50,190,86,427],"topic":[],"class_list":["post-119791","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-1024---","tag-java","tag-50","tag-190","tag-86","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C++17 \u00b7 CMake 3.20+ \u00b7 HTTP\/HTTPS \u00b7 \u9759\u6001\u5e93\u96c6\u6210 \u00b7 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8 AI\u5927\u6a21\u578bSDK\u5b9e\u6218\uff5cChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c - \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\/119791.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++17 \u00b7 CMake 3.20+ \u00b7 HTTP\/HTTPS \u00b7 \u9759\u6001\u5e93\u96c6\u6210 \u00b7 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8 AI\u5927\u6a21\u578bSDK\u5b9e\u6218\uff5cChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"C17\u00a0 \u00b7\u00a0 CMake 3.20\u00a0 \u00b7\u00a0 HTTP\/HTTPS\u00a0 \u00b7\u00a0 \u9759\u6001\u5e93\u96c6\u6210\u00a0 \u00b7\u00a0 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8AI\u5927\u6a21\u578bSDK\u5b9e\u6218&#xff5c;ChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c\u5b9a\u4f4d#C\u00a0 #CMake\u00a0 #CMakeLists.txt\u00a0 #ChatServer\u00a0 #AI\u5927\u6a21\u578b\u00a0 #SDK\u5f00\u53d1\u00a0 #HTTP\u670d\u52a1\u5668\u00a0 #\u9759\u6001\u5e93\u94fe\u63a5\u00a0 #Linux\u00a0 #\u5de5\u7a0b\u5316ChatServer \u4e3a\u4ec0\u4e48\u5728\u5f00\u53d1\u673a\u4e0a\u80fd\u7f16\u8bd1&#xff0c;\u6362\u4e2a\u73af\u5883\u5374\u627e\u4e0d\u5230\u5934\u6587\u4ef6\u3001\u9759\u6001\u5e93\u6216\u8fd0\u884c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/119791.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-30T04:24:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042444-6ae41c0cae676.jpg\" \/>\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=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/119791.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/119791.html\",\"name\":\"C++17 \u00b7 CMake 3.20+ \u00b7 HTTP\/HTTPS \u00b7 \u9759\u6001\u5e93\u96c6\u6210 \u00b7 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8 AI\u5927\u6a21\u578bSDK\u5b9e\u6218\uff5cChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-30T04:24:47+00:00\",\"dateModified\":\"2026-10-30T04:24:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/119791.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/119791.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/119791.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++17 \u00b7 CMake 3.20+ \u00b7 HTTP\/HTTPS \u00b7 \u9759\u6001\u5e93\u96c6\u6210 \u00b7 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8 AI\u5927\u6a21\u578bSDK\u5b9e\u6218\uff5cChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c\"}]},{\"@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":"C++17 \u00b7 CMake 3.20+ \u00b7 HTTP\/HTTPS \u00b7 \u9759\u6001\u5e93\u96c6\u6210 \u00b7 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8 AI\u5927\u6a21\u578bSDK\u5b9e\u6218\uff5cChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c - \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\/119791.html","og_locale":"zh_CN","og_type":"article","og_title":"C++17 \u00b7 CMake 3.20+ \u00b7 HTTP\/HTTPS \u00b7 \u9759\u6001\u5e93\u96c6\u6210 \u00b7 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8 AI\u5927\u6a21\u578bSDK\u5b9e\u6218\uff5cChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"C17\u00a0 \u00b7\u00a0 CMake 3.20\u00a0 \u00b7\u00a0 HTTP\/HTTPS\u00a0 \u00b7\u00a0 \u9759\u6001\u5e93\u96c6\u6210\u00a0 \u00b7\u00a0 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8AI\u5927\u6a21\u578bSDK\u5b9e\u6218&#xff5c;ChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c\u5b9a\u4f4d#C\u00a0 #CMake\u00a0 #CMakeLists.txt\u00a0 #ChatServer\u00a0 #AI\u5927\u6a21\u578b\u00a0 #SDK\u5f00\u53d1\u00a0 #HTTP\u670d\u52a1\u5668\u00a0 #\u9759\u6001\u5e93\u94fe\u63a5\u00a0 #Linux\u00a0 #\u5de5\u7a0b\u5316ChatServer \u4e3a\u4ec0\u4e48\u5728\u5f00\u53d1\u673a\u4e0a\u80fd\u7f16\u8bd1&#xff0c;\u6362\u4e2a\u73af\u5883\u5374\u627e\u4e0d\u5230\u5934\u6587\u4ef6\u3001\u9759\u6001\u5e93\u6216\u8fd0\u884c","og_url":"https:\/\/www.wsisp.com\/helps\/119791.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-30T04:24:47+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261030042444-6ae41c0cae676.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/119791.html","url":"https:\/\/www.wsisp.com\/helps\/119791.html","name":"C++17 \u00b7 CMake 3.20+ \u00b7 HTTP\/HTTPS \u00b7 \u9759\u6001\u5e93\u96c6\u6210 \u00b7 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8 AI\u5927\u6a21\u578bSDK\u5b9e\u6218\uff5cChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-30T04:24:47+00:00","dateModified":"2026-10-30T04:24:47+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/119791.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/119791.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/119791.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C++17 \u00b7 CMake 3.20+ \u00b7 HTTP\/HTTPS \u00b7 \u9759\u6001\u5e93\u96c6\u6210 \u00b7 \u53ef\u9a8c\u8bc1\u4ea4\u4ed8 AI\u5927\u6a21\u578bSDK\u5b9e\u6218\uff5cChatServer\u4ece\u96f6\u6784\u5efa\u2014\u2014\u73b0\u4ee3CMake\u3001\u4f9d\u8d56\u94fe\u63a5\u4e0e\u6545\u969c"}]},{"@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\/119791","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=119791"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/119791\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/119780"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=119791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=119791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=119791"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=119791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}