hankchan / goctp

Golang bindings for CTP.
MIT License
100 stars 71 forks source link

win64平台编译失败 #4

Open mineralres opened 6 years ago

mineralres commented 6 years ago

请问有没有在win64下编译的注意事项?我编译出现如下错误:

go build github.com/qerio/goctp: invalid flag in #cgo LDFLAGS: -Wl,-rpath=C:/Users/admin/go/src/github.com/qerio/goctp/api/ThostTraderApi_v6.3.6/win64

go version go1.10 windows/amd64

ewin1018 commented 6 years ago

mineralres ,win64 后来编译成了没?

sunnyboy00 commented 6 years ago

Windows系统的dll用的vs编译器,导出的Dll没有用extern c ,gcc 编译各种坑,直接放弃

mineralres commented 6 years ago

我也弃坑了,golang加c, c++用起来特别不爽

hankchan commented 6 years ago

修改“-Wl,-rpath=”为“-Wl,-rpath,”,避免报错。这个问题已经解决。

sunnyboy00 commented 6 years ago

仍然不行

go build github.com/qerio/goctp: invalid flag in #cgo LDFLAGS: C:/Users/Administ rator/go/src/github.com/qerio/goctp/api/SFIT_CTP_6.3.11_20180109_tradeapi/201801 09_tradeapi64_windows/thostmduserapi.lib

sunnyboy00 commented 6 years ago

修改“-Wl,-rpath=”为“-Wl,-rpath,”,避免报错。这个问题已经解决。 设置了 export CGO_CXXFLAGS_ALLOW="." export CGO_LDFLAGS_ALLOW="." export CGO_CFLAGS_ALLOW="." 之后,显示以下错误 C:\Users\ADMINI~1\AppData\Local\Temp\go-build872063822\b001_x004.o: In function _wrap_CThostFtdcMdApi_CreateFtdcMdApi__SWIG_3_goctp_1eab63fb76b94638': /tmp/go-build/goctp_wrap.cxx:131615: undefined reference toCThostFtdcMdApi::CreateFtdcMdApi(char const, bool, bool)' C:\Users\ADMINI~1\AppData\Local\Temp\go-build872063822\b001_x004.o: In function _wrap_CThostFtdcTraderApi_CreateFtdcTraderApi__SWIG_1_goctp_1eab63fb76b94638': /tmp/go-build/goctp_wrap.cxx:135899: undefined reference toCThostFtdcTraderApi::CreateFtdcTraderApi(char const*)' collect2.exe: error: ld returned 1 exit status

hankchan commented 6 years ago

@sunnyboy00 这个问题我正在解决,目前主要确定CGO是否支持Windows DLL 或 lib文件的加载。