Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win64平台编译失败 #4

Open
mineralres opened this issue Mar 22, 2018 · 7 comments
Open

win64平台编译失败 #4

mineralres opened this issue Mar 22, 2018 · 7 comments

Comments

@mineralres
Copy link

mineralres commented Mar 22, 2018

请问有没有在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
Copy link

mineralres ,win64 后来编译成了没?

@sunnyboy00
Copy link

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

@mineralres
Copy link
Author

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

@hankchan
Copy link
Owner

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

@sunnyboy00
Copy link

仍然不行

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
Copy link

修改“-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 to CThostFtdcMdApi::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 to CThostFtdcTraderApi::CreateFtdcTraderApi(char const*)'
collect2.exe: error: ld returned 1 exit status

@hankchan
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants