1 Star 0 Fork 39

吴中玉 / goctp

forked from 海风 / goctp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

goctp

介绍

CTP 封装之 golang 版,支持 Windows Linux x64. 采用二次封装,将 C++封装成 C,并 export. win lnx 封装逻辑相同: trade.go quote.go

运行

环境变量

"tradeFront": "tcp://180.168.146.187:10130",
"quoteFront": "tcp://180.168.146.187:10131",
"loginInfo": "9999/008107/1/simnow_client_test/0000000000000000"

看穿式评测

# lnx
cp CTPv6.3.19_20200423_cp/*.so lnx/
# win
cp ctp_6.6.1_20210406_cp/*.dll win/
GOOS=windows GOARCH=amd64 go build -o ctp_auth.exe demo/main.go
tar -czf ctp_auth.tgz ctp_auth.exe ./win/*.dll
# 解压后,复制win下dll到 ctp_auth.exe 目录下
set tradeFront=tcp://180.168.146.187:10130
set quoteFront=tcp://180.168.146.187:10131
set loginInfo=9999/008106/jie123465/simnow_client_test/0000000000000000
ctp_auth.exe

示例

main.go

版本切换

复制 6.5.1 版本以上官方库文件覆盖到 lnx win 下同名文件即可。

QA

operator delete(void*, unsigned long)@CXXABI_1.3.9’未定义的引用

不同系统,不同版本的底层依赖不同 重新编译即可

cd lnx && g++ -shared -fPIC -Wl,-rpath . -o ./libctp_quote.so ../generate/quote.cpp  thostmduserapi_se.so && cd ..
cd lnx && g++ -shared -fPIC -Wl,-rpath . -o ./libctp_trade.so ../generate/trade.cpp  thosttraderapi_se.so && cd ..
MIT License Copyright (c) 2019 海风 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

CTP封装之golang版(支持windows linux x64) 展开 收起
Go
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/wuzhongyu1234/goctp.git
git@gitee.com:wuzhongyu1234/goctp.git
wuzhongyu1234
goctp
goctp
master

搜索帮助