-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/cgo: could not determine kind of name for C.CStirng #31390
Comments
I can't recreate the problem. There are typos in your sample code; for example, you wrote |
Hi Ian, Apologies for typo.A small excerpt from the code. package main
}
} I am trying to load an external library.The header file points to the match function.When I run 'go build main.go' it shows the following issue: could not determine kind of name for C.CStirng All the C dependencies reside in the abc folder.Do I need to zip the dependencies ? $ go env |
@nitishsaboo please attach (or link to) a complete source file that exhibits the problem, not just an excerpt. If there is a bug here, we need to be able to reproduce it in order to determine when we have fixed it. |
If the error messages quoted above are exactly what you see, then the bug is that your code has typos for |
Thanks Ian.Issue resolved |
how to fix it? pleae teach me |
@xiaokai111 there was a typo that resolved the issue. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Not Sure
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am building the go code that is binded with the C code.
pacage main
// #include "stdlib.h"
import "C"
import (
"fmt"
_ "fmt"
"regexp"
"strconv"
"unsafe"
)
func process(program string, message string) {
}
What did you expect to see?
I thought the code would build successfully
What did you see instead?
$ go build main.go
command-line-arguments
./main.go:136:16: could not determine kind of name for C.CStirng
./main.go:87:20: could not determine kind of name for C.String
The text was updated successfully, but these errors were encountered: