Go run -tags cse main.go error

go run -tags cse main.go
# go.mongodb.org/mongo-driver/x/mongo/driver/mongocrypt
…/…/go/pkg/mod/go.mongodb.org/mongo-driver@v1.7.1/x/mongo/driver/mongocrypt/mongocrypt.go:134:11: could not determine kind of name for C.mongocrypt_ctx_setopt_key_encryption_key
…/…/go/pkg/mod/go.mongodb.org/mongo-driver@v1.7.1/x/mongo/driver/mongocrypt/mongocrypt.go:212:11: could not determine kind of name for C.mongocrypt_setopt_kms_providers

Please explain why this error is generated.

Hi @Sonu_Sharma, this error indicates the driver is attempting to build against an older dependency of libmongocrypt. If you are using Go driver 1.5.0 or higher, it requires libmongocrypt version 1.1.0 or higher as noted in the mongo package documentation.


1 Like