On Tue, Aug 29, 2017 at 1:24 PM, Adrian Sampaleanu <nman...@gmail.com> wrote:
>
> When running "go build" on the following code:
>
> package main
>
> // #include <stdlib.h>
> import "C"
>
> func Random() int {
>    return int(C.random())
> }
>
> func Seed(i int) {
>    C.srandom(C.uint(i))
> }
>
> func main() {
> }
>
>
> I get this output:
> .\main.go:7:13: could not determine kind of name for C.random
> .\main.go:11:2: could not determine kind of name for C.srandom
>
> Having never used cgo before, I'm not sure if I'm doing something wrong, but
> I don't see the problem. Am I hitting this
> (https://github.com/golang/go/issues/21668) ?

I doubt this is issue 21668, which is specific to certain names.  I'm
not sure what the problem is.  Your test case works for me.  What
system are you running on?  What is your C compiler?

(Note that you can use the math/rand package to get pseudo-random
numbers, no need to use cgo for that.)

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to