随心随欲罢不能 发表于 2021-3-23 10:06

Golang连接达梦数据库

本帖最后由 随心随欲罢不能 于 2021-3-23 11:32 编辑

使用Golang连接达梦数据库,按照官方的demo,引入了达梦Go语言驱动包,但是在编译时出现以下错误:
# dm/security
../dm/security/zze.go:35:8: undefined: initThirdPartCipher
../dm/security/zze.go:46:21: undefined: cipherGetCount
../dm/security/zze.go:56:3: undefined: cipherGetInfo
../dm/security/zze.go:70:2: undefined: cipherEncryptInit
../dm/security/zze.go:72:19: undefined: cipherGetCipherTextSize
../dm/security/zze.go:75:9: undefined: cipherEncrypt
../dm/security/zze.go:79:2: undefined: cipherClean
../dm/security/zze.go:110:2: undefined: cipherDecryptInit
../dm/security/zze.go:113:9: undefined: cipherDecrypt
../dm/security/zze.go:117:2: undefined: cipherClean
../dm/security/zze.go:117:2: too many errors

有没有遇见过这个问题的朋友,如何解决?如有了解的朋友帮忙解答,小弟感激不尽!

--------------
问题找到了,达梦数据库Go驱动对编译环境是有要求的,只能在windows或者linux系统下进行编译,本人用的是macos,因此编译时显示如上错误。
解决方法是通过设置编译参数,在macos上编译,但不能在macos上面运行。
env GOOS=linux go build main.go

ailuo2005 发表于 2021-3-23 11:16

虽然看不懂,还是帮顶
页: [1]
查看完整版本: Golang连接达梦数据库