{"id":1759,"date":"2026-04-11T22:55:36","date_gmt":"2026-04-12T06:55:36","guid":{"rendered":"https:\/\/zhaomihao.com\/zh\/?p=1759"},"modified":"2026-04-11T23:21:48","modified_gmt":"2026-04-12T07:21:48","slug":"compiling-ctp-in-go","status":"publish","type":"post","link":"https:\/\/zhaomihao.com\/zh\/compiling-ctp-in-go\/","title":{"rendered":"\u5728Go\u8bed\u8a00\u4e2d\u7f16\u8bd1CTP"},"content":{"rendered":"\n<p>CTP\u662f\u4e0a\u671f\u6280\u672f\u5f00\u53d1\u7684\u671f\u8d27\u4ea4\u6613\u6838\u5fc3\u7cfb\u7edf\uff0c\u4ee5\u6781\u901f\u3001\u7a33\u5b9a\u8457\u79f0\u3002\u5b83\u63d0\u4f9b\u9ad8\u6548\u4ea4\u6613\u6267\u884c\u3001\u5b9e\u65f6\u98ce\u63a7\u4e0e\u884c\u60c5\u670d\u52a1\uff0c\u662f\u4e13\u4e1a\u6295\u8d44\u8005\u4e0e\u671f\u8d27\u516c\u53f8\u9996\u9009\u7684\u5e95\u5c42\u6280\u672f\u5e73\u53f0\u3002<\/p>\n\n\n\n<p>Golang \u662f\u7531 Google \u5f00\u53d1\u7684\u5f00\u6e90\u7f16\u7a0b\u8bed\u8a00\uff0c\u4ee5\u7b80\u6d01\u8bed\u6cd5\u3001\u9ad8\u6548\u5e76\u53d1\u548c\u5feb\u901f\u7f16\u8bd1\u8457\u79f0\u3002\u5b83\u7ed3\u5408\u4e86\u9759\u6001\u8bed\u8a00\u7684\u5b89\u5168\u6027\u4e0e\u52a8\u6001\u8bed\u8a00\u7684\u7075\u6d3b\u6027\uff0c\u975e\u5e38\u9002\u5408\u6784\u5efa\u9ad8\u6027\u80fd\u3001\u53ef\u6269\u5c55\u7684\u7f51\u7edc\u670d\u52a1\u4e0e\u4e91\u539f\u751f\u5e94\u7528\u3002<\/p>\n\n\n\n<p>CTP\u4f7f\u7528C++\u7f16\u7a0b\u8bed\u8a00\u7f16\u5199\uff0c\u4e0d\u80fd\u5728Go\u4ee3\u7801\u4e2d\u76f4\u63a5\u8c03\u7528\u3002\u8981\u60f3\u5728Go\u4ee3\u7801\u4e2d\u8c03\u7528CTP\uff0c\u4e00\u4e2a\u53ef\u884c\u7684\u6280\u672f\u65b9\u6848\u662f\u4f7f\u7528SWIG\u5bf9CTP\u8fdb\u884c\u7ffb\u8bd1\u548c\u5305\u88c5\uff0c\u7136\u540e\u4f7f\u7528cgo\u8fdb\u884c\u8c03\u7528\u3002\u4e0b\u9762\u5bf9\u8fd9\u79cd\u65b9\u6cd5\u8fdb\u884c\u8be6\u7ec6\u4ecb\u7ecd\u3002<\/p>\n\n\n\n<p>\u5047\u8bbe\u5de5\u4f5c\u76ee\u5f55\u4e3a\/home\/netxianren\/workspace\/myctp\/src\/myctp, \u8be5\u76ee\u5f55\u5305\u542b\u7684\u6587\u4ef6\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>error.dtd\nerror.xml\nlibthostmduserapi_se.so\nlibthosttraderapi_se.so\nThostFtdcMdApi.h\nThostFtdcTraderApi.h\nThostFtdcUserApiDataType.h\nThostFtdcUserApiStruct.h\ngo.mod\nlibmyctp.go\nmyctp.swigcxx<\/code><\/pre>\n\n\n\n<p>myctp\u76ee\u5f55\u5171\u5305\u542b11\u4e2a\u6587\u4ef6\uff0c\u524d8\u4e2a\u6587\u4ef6\u7531\u4e0a\u671f\u6280\u672f\u63d0\u4f9b\uff0c2\u4e2a\u52a8\u6001\u94fe\u63a5\u5e93\u6587\u4ef6libthostmduserapi_se.so\u548clibthosttraderapi_se.so\u662f\u5728\u5b98\u65b9\u6587\u4ef6\u57fa\u7840\u4e0a\u6539\u540d\u800c\u6765\uff0c\u5b98\u65b9\u6587\u4ef6\u540d\u79f0\u4e3athostmduserapi_se.so\u548cthosttraderapi_se.so\uff0c\u5206\u522b\u5728\u6587\u4ef6\u540d\u7684\u5f00\u5934\u4f4d\u7f6e\u589e\u52a0\u4e86lib 3\u4e2a\u5b57\u6bcd\u3002<\/p>\n\n\n\n<p>go.mod\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>module myctp\n\ngo 1.21<\/code><\/pre>\n\n\n\n<p>go.mod\u6587\u4ef6\u5185\u5bb9\u7684\u7b2c1\u884c\u6307\u5b9a\u4e86\u7f16\u8bd1\u540e\u7684go\u6a21\u5757\u7684\u540d\u79f0\uff0c\u7b2c2\u884c\u6307\u5b9a\u4e86go\u7684\u7248\u672c\u3002<\/p>\n\n\n\n<p>libmyctp.go\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/go:build (linux &amp;&amp; cgo) || (windows &amp;&amp; cgo)\n\/\/ +build linux,cgo windows,cgo\n\n\/\/ Copyright 2012 The Go Authors.  All rights reserved.\n\/\/ Use of this source code is governed by a BSD-style\n\/\/ license that can be found in the LICENSE file.\n\npackage myctp\n\n\/*\n#cgo linux LDFLAGS: -fPIC -L${SRCDIR}\/ -lthostmduserapi_se -lthosttraderapi_se -lstdc++\n#cgo linux CPPFLAGS: -fPIC -I${SRCDIR}\/\n*\/\nimport \"C\"<\/code><\/pre>\n\n\n\n<p>myctp.swigcxx\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* Copyright 2011 The Go Authors.  All rights reserved.\n   Use of this source code is governed by a BSD-style\n   license that can be found in the LICENSE file.  *\/\n\n\/* An example of writing a C++ virtual function in Go.  *\/\n\n%module(directors=\"1\") myctp\n\n%header %{\n#include \"ThostFtdcUserApiDataType.h\"\n#include \"ThostFtdcUserApiStruct.h\"\n#include \"ThostFtdcMdApi.h\"\n#include \"ThostFtdcTraderApi.h\"\n%}\n\n%init %{ \n  \/\/printf(\"Initialization qerio.goctp done.\\n\");\n%}\n\n\n\n%typemap(gotype) (char **ppInstrumentID, int nCount) \"&#91;]string\"\n\n\n%typemap(in) (char **ppInstrumentID, int nCount)\n%{\n  {\n    int i;\n    _gostring_* a;\n\n    $2 = $input.len;\n    a = (_gostring_*) $input.array;\n    $1 = (char **) malloc (($2 + 1) * sizeof (char *));\n    for (i = 0; i &lt; $2; i++) {\n      \n      \/* Not work *\/\n      \/\/_gostring_ *ps = &amp;a&#91;i];\n      \/\/$1&#91;i] = (char *) ps->p;\n      \/\/$1&#91;i]&#91;ps->n] = '\\0';\n\n      \/*Work well*\/\n      _gostring_ *ps = &amp;a&#91;i];\n      $1&#91;i] = (char*) malloc(ps->n + 1);\n      memcpy($1&#91;i], ps->p, ps->n);\n      $1&#91;i]&#91;ps->n] = '\\0';\n\n    }\n    $1&#91;i] = NULL;\n  }\n%}\n\n%typemap(argout) (char **ppInstrumentID, int nCount) \"\" \/* override char *&#91;] default *\/\n\n%typemap(freearg) (char **ppInstrumentID, int nCount)\n%{\n  {\n    int i;\n    for (i = 0; i &lt; $2; i++)\n    {\n      free ($1&#91;i]);\n    }\n    free($1);\n  }\n%}\n\n\n\n\/* Parse the header files to generate wrappers *\/\n%include \"std_string.i\"\n\n%feature(\"director\") CThostFtdcMdSpi;\n%feature(\"director\") CThostFtdcTraderSpi;\n\n%include \"ThostFtdcUserApiDataType.h\"\n%include \"ThostFtdcUserApiStruct.h\"\n%include \"ThostFtdcMdApi.h\"\n%include \"ThostFtdcTraderApi.h\"\n<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u76f4\u63a5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u7f16\u8bd1\uff0c\u4f1a\u62a5\u9519\uff1a\/tmp\/go-build2454150057\/b002\/_myctp_swig.go:20438:46: illegal rune literal<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>go build<\/code><\/pre>\n\n\n\n<p>\u539f\u56e0\u662f\u81ea\u52a8\u751f\u6210\u7684Go\u4ee3\u7801\u4e2d\u5305\u542b\u5982\u4e0b\u7684\u4ee3\u7801\u3002\u53ef\u4ee5\u770b\u51fa\u6765\uff0c\u8fd9\u6bb5\u4ee3\u7801\u6709\u95ee\u9898\uff0c\u5b57\u7b26\u4e32\u88ab\u5305\u542b\u5728\u5355\u5f15\u53f7\u4e2d(\u6309\u7167Go\u8bed\u6cd5\uff0c\u5b57\u7b26\u4e32\u5e94\u8be5\u88ab\u5305\u542b\u5728\u53cc\u5f15\u53f7\u4e2d)\uff0c\u800c\u4e14\uff0c\u628a\u5b57\u7b26\u4e32\u8d4b\u503c\u7ed9byte\u53d8\u91cf\u4e5f\u6709\u95ee\u9898\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const THOST_FTDC_VTC_BankBankToFuture byte = '102001'\nconst THOST_FTDC_VTC_BankFutureToBank byte = '102002'\nconst THOST_FTDC_VTC_FutureBankToFuture byte = '202001'\nconst THOST_FTDC_VTC_FutureFutureToBank byte = '202002'<\/code><\/pre>\n\n\n\n<p>\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u4e00\u79cd\u65b9\u6cd5\u662f\u4fee\u6539\u6587\u4ef6 ThostFtdcUserApiDataType.h\u4e2d\u5982\u4e0b\u90e8\u5206\u7684\u5185\u5bb9\uff0c\u76f4\u63a5\u628a\u8fd98\u884c\u4ee3\u7801\u6ce8\u91ca\u8c03\u3002\u6ce8\u91ca\u6389\u4e4b\u540e\uff0c\u7f16\u8bd1\u4e0d\u4f1a\u518d\u62a5\u9519\uff0c\u4f46\u662f\u5e26\u6765\u7684\u8d1f\u9762\u5f71\u54cd\u662fGo\u4ee3\u7801\u4e2d\u6ca1\u6709\u5bf9\u5e94\u7684\u5e38\u91cf\u5b9a\u4e49\uff0c\u65e0\u6cd5\u5728Go\u4ee3\u7801\u4e2d\u76f4\u63a5\u8c03\u7528\u4f7f\u7528\u8fd9\u4e9b\u5e38\u91cf\u7684\u51fd\u6570\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/TFtdcVirementTradeCodeType\u662f\u4e00\u4e2a\u4ea4\u6613\u4ee3\u7801\u7c7b\u578b\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\u94f6\u884c\u53d1\u8d77\u94f6\u884c\u8d44\u91d1\u8f6c\u671f\u8d27\n\/\/#define THOST_FTDC_VTC_BankBankToFuture '102001'\n\/\/\/\u94f6\u884c\u53d1\u8d77\u671f\u8d27\u8d44\u91d1\u8f6c\u94f6\u884c\n\/\/#define THOST_FTDC_VTC_BankFutureToBank '102002'\n\/\/\/\u671f\u8d27\u53d1\u8d77\u94f6\u884c\u8d44\u91d1\u8f6c\u671f\u8d27\n\/\/#define THOST_FTDC_VTC_FutureBankToFuture '202001'\n\/\/\/\u671f\u8d27\u53d1\u8d77\u671f\u8d27\u8d44\u91d1\u8f6c\u94f6\u884c\n\/\/#define THOST_FTDC_VTC_FutureFutureToBank '202002'\n\n......\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/TFtdcFBTTradeCodeEnumType\u662f\u4e00\u4e2a\u94f6\u671f\u4ea4\u6613\u4ee3\u7801\u679a\u4e3e\u7c7b\u578b\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\u94f6\u884c\u53d1\u8d77\u94f6\u884c\u8f6c\u671f\u8d27\n\/\/#define THOST_FTDC_FTC_BankLaunchBankToBroker '102001'\n\/\/\/\u671f\u8d27\u53d1\u8d77\u94f6\u884c\u8f6c\u671f\u8d27\n\/\/#define THOST_FTDC_FTC_BrokerLaunchBankToBroker '202001'\n\/\/\/\u94f6\u884c\u53d1\u8d77\u671f\u8d27\u8f6c\u94f6\u884c\n\/\/#define THOST_FTDC_FTC_BankLaunchBrokerToBank '102002'\n\/\/\/\u671f\u8d27\u53d1\u8d77\u671f\u8d27\u8f6c\u94f6\u884c\n\/\/#define THOST_FTDC_FTC_BrokerLaunchBrokerToBank '202002'\n<\/code><\/pre>\n\n\n\n<p>\u6587\u4ef6 ThostFtdcMdApi.h \u90e8\u5206\u5185\u5bb9\u4e5f\u9700\u8981\u4fee\u6539\u3002\u5728C++\u4e2d\uff0c\u53d8\u91cf\u7c7b\u578bchar *ppInstrumentID[]\u548cchar **ppInstrumentID\u6ca1\u6709\u4efb\u4f55\u533a\u522b\uff0c\u4f46\u662f\u53d8\u91cf\u7c7b\u578bchar *ppInstrumentID[]\u88ab\u5305\u88c5\u540e\u5728Go\u4ee3\u7801\u4e2d\u7f16\u8bd1\u4f1a\u51fa\u9519\uff0c\u53d8\u91cf\u7c7b\u578bchar **ppInstrumentID\u5728Go\u4ee3\u7801\u4e2d\u7f16\u8bd1\u53ef\u4ee5\u901a\u8fc7\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\/\u8ba2\u9605\u884c\u60c5\u3002\n\t\/\/\/@param ppInstrumentID \u5408\u7ea6ID  \n\t\/\/\/@param nCount \u8981\u8ba2\u9605\/\u9000\u8ba2\u884c\u60c5\u7684\u5408\u7ea6\u4e2a\u6570\n\t\/\/\/@remark \n\t\/\/virtual int SubscribeMarketData(char *ppInstrumentID&#91;], int nCount) = 0;\n        virtual int SubscribeMarketData(char **ppInstrumentID, int nCount) = 0;\n\n\t\/\/\/\u9000\u8ba2\u884c\u60c5\u3002\n\t\/\/\/@param ppInstrumentID \u5408\u7ea6ID  \n\t\/\/\/@param nCount \u8981\u8ba2\u9605\/\u9000\u8ba2\u884c\u60c5\u7684\u5408\u7ea6\u4e2a\u6570\n\t\/\/\/@remark \n\t\/\/virtual int UnSubscribeMarketData(char *ppInstrumentID&#91;], int nCount) = 0;\n        virtual int UnSubscribeMarketData(char **ppInstrumentID, int nCount) = 0;\n\t\n\t\/\/\/\u8ba2\u9605\u8be2\u4ef7\u3002\n\t\/\/\/@param ppInstrumentID \u5408\u7ea6ID  \n\t\/\/\/@param nCount \u8981\u8ba2\u9605\/\u9000\u8ba2\u884c\u60c5\u7684\u5408\u7ea6\u4e2a\u6570\n\t\/\/\/@remark \n\t\/\/virtual int SubscribeForQuoteRsp(char *ppInstrumentID&#91;], int nCount) = 0;\n        virtual int SubscribeForQuoteRsp(char **ppInstrumentID, int nCount) = 0;\n\n\t\/\/\/\u9000\u8ba2\u8be2\u4ef7\u3002\n\t\/\/\/@param ppInstrumentID \u5408\u7ea6ID  \n\t\/\/\/@param nCount \u8981\u8ba2\u9605\/\u9000\u8ba2\u884c\u60c5\u7684\u5408\u7ea6\u4e2a\u6570\n\t\/\/\/@remark \n\t\/\/virtual int UnSubscribeForQuoteRsp(char *ppInstrumentID&#91;], int nCount) = 0;\n        virtual int UnSubscribeForQuoteRsp(char **ppInstrumentID, int nCount) = 0;<\/code><\/pre>\n\n\n\n<p>\u8fd8\u6709\u4e00\u4e9b\u5176\u4ed6\u7684\u4f9d\u8d56\u9879\u3002\u6211\u7684\u7535\u8111\u4e0a\uff0c\u8f6f\u4ef6\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u64cd\u4f5c\u7cfb\u7edf\uff1aubuntu 22.04<\/li>\n\n\n\n<li>Go \u7248\u672c\uff1a1.21.1<\/li>\n\n\n\n<li>SWIG \u7248\u672c\uff1a4.0.2<\/li>\n\n\n\n<li>g++\u7248\u672c\uff1a 11.4.0<\/li>\n<\/ul>\n\n\n\n<p>\u4e00\u5207\u51c6\u5907\u5c31\u7eea\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u7f16\u8bd1\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export GOPATH=$GOPATH:'\/home\/netxianren\/workspace\/myctp'\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:'\/home\/netxianren\/workspace\/myctp\/src\/myctp'\ncd \/home\/netxianren\/workspace\/myctp\/src\/myctp\ngo install -x -v -work<\/code><\/pre>\n\n\n\n<p>\u4e5f\u53ef\u4ee5\u5728LiteIDE\u96c6\u6210\u5de5\u5177\u4e2d\u76f4\u63a5\u70b9\u51fbBuild\u6309\u94ae\u8fdb\u884c\u7f16\u8bd1\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u4e0a\u8ff0\u529e\u6cd5\uff0c\u672c\u4eba\u5df2\u6210\u529f\u7f16\u8bd1CTP 6.3.15, CTP 6.3.16, CTP 6.5.1, CTP 6.7.13 \u56db\u4e2a\u7248\u672c\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u5728LiteIDE\u4e2d\u7684\u81ea\u52a8\u8865\u5168\u529f\u80fd<\/h4>\n\n\n\n<p>\u82e5\u8981\u5728LiteIDE\u91cc\u5b9e\u73b0\u4ee3\u7801\u81ea\u52a8\u8865\u5168\u529f\u80fd\uff0c\u9700\u8981\u5728\u5305\u76ee\u5f55\/home\/netxianren\/workspace\/myctp\/src\/myctp\u91cc\u653e\u4e00\u4e2a\u6587\u4ef6myctp.go(\u7531swig\u751f\u6210)\uff0c\u4f46\u662f\u8fd9\u4e2a\u6587\u4ef6\u4f1a\u5bfc\u81f4\u7f16\u8bd1\u65f6\u65f6\u95f4\u5f88\u957f\u3002<br>\u89e3\u51b3\u529e\u6cd5\u4e3a\uff1a\u7f16\u8bd1\u65f6\u4fee\u6539\u8fd9\u4e2a\u6587\u4ef6\u7684\u6269\u5c55\u540d\uff0c\u7f16\u8bd1\u5b8c\u6210\u540e\u6269\u5c55\u540d\u518d\u6539\u4e3ago.<\/p>\n\n\n\n<p>\u751f\u6210myctp.go\u7684\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>swig -c++ -go -cgo -intgosize 64 myctp.swigcxx<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u90e8\u7f72\u65f6\u6307\u5b9a\u52a0\u8f7d\u52a8\u6001\u94fe\u63a5\u5e93\u7684\u8def\u5f84<\/h4>\n\n\n\n<p>\u6b63\u5e38\u90e8\u7f72\u65f6\uff0c\u5c06\u52a8\u6001\u94fe\u63a5\u5e93\u6587\u4ef6libthostmduserapi_se.so\u548clibthosttraderapi_se.so\u590d\u5236\u5230\u7cfb\u7edf\u5e93\u6587\u4ef6\u76ee\u5f55\u5373\u53ef\uff0c\u5728ubuntu\u7cfb\u7edf\u4e0a\uff0c\u901a\u5e38\u662f\u7cfb\u7edf\u5e93\u6587\u4ef6\u76ee\u5f55\/usr\/lib\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\u6709\u65f6\u5019\uff0c\u6211\u4eec\u4e0d\u5e0c\u671b\u4ece\u7cfb\u7edf\u5e93\u6587\u4ef6\u76ee\u5f55\u52a0\u8f7d\uff0c\u800c\u662f\u4ece\u53ef\u6267\u884c\u7a0b\u5e8f\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u52a0\u8f7d\u52a8\u6001\u94fe\u63a5\u5e93\uff0c\u8fd9\u6837\u53ef\u4ee5\u5b9e\u73b0\u540c\u4e00\u53f0\u7535\u8111\u4e0a\u90e8\u7f72\u7684\u591a\u4e2a\u53ef\u6267\u884c\u7a0b\u5e8f\u52a0\u8f7d\u4e0d\u540c\u7684CTP\u7248\u672c\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539LD_LIBRARY_PATH\u6765\u5b9e\u73b0\u3002\u5047\u8bbe\u9700\u8981\u52a0\u8f7dCTP\u52a8\u6001\u94fe\u63a5\u5e93\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u4e3afuture, \u53ef\u6267\u884c\u7a0b\u5e8ffuture\u6240\u5728\u76ee\u5f55\u4e3a\/var\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u542f\u52a8future, \u6b64\u65f6future\u4f1a\u4f18\u5148\u4ece\/var\u76ee\u5f55\u52a0\u8f7d\u52a8\u6001\u94fe\u63a5\u5e93\u6587\u4ef6libthostmduserapi_se.so\u548clibthosttraderapi_se.so\uff0c\u5c06\u6587\u4ef6libthostmduserapi_se.so\u548clibthosttraderapi_se.so\u590d\u5236\u5230\/var\u5373\u53ef\u4fdd\u8bc1\u6210\u529f\u52a0\u8f7d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LD_LIBRARY_PATH='\/var':$LD_LIBRARY_PATH \/var\/future<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CTP\u662f\u4e0a\u671f\u6280\u672f\u5f00\u53d1\u7684\u671f\u8d27\u4ea4\u6613\u6838\u5fc3\u7cfb\u7edf\uff0c\u4ee5\u6781\u901f\u3001\u7a33\u5b9a\u8457\u79f0\u3002\u5b83\u63d0\u4f9b\u9ad8\u6548\u4ea4\u6613\u6267\u884c\u3001\u5b9e\u65f6\u98ce\u63a7\u4e0e\u884c\u60c5\u670d\u52a1\uff0c\u662f\u4e13\u4e1a\u6295\u8d44\u8005 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[26,25],"class_list":["post-1759","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ctp","tag-go"],"_links":{"self":[{"href":"https:\/\/zhaomihao.com\/zh\/wp-json\/wp\/v2\/posts\/1759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhaomihao.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhaomihao.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhaomihao.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhaomihao.com\/zh\/wp-json\/wp\/v2\/comments?post=1759"}],"version-history":[{"count":6,"href":"https:\/\/zhaomihao.com\/zh\/wp-json\/wp\/v2\/posts\/1759\/revisions"}],"predecessor-version":[{"id":1767,"href":"https:\/\/zhaomihao.com\/zh\/wp-json\/wp\/v2\/posts\/1759\/revisions\/1767"}],"wp:attachment":[{"href":"https:\/\/zhaomihao.com\/zh\/wp-json\/wp\/v2\/media?parent=1759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhaomihao.com\/zh\/wp-json\/wp\/v2\/categories?post=1759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhaomihao.com\/zh\/wp-json\/wp\/v2\/tags?post=1759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}