Re: [go-nuts] cgo build error

2019-11-04 Thread Ian Lance Taylor
On Sun, Nov 3, 2019 at 7:03 AM Bill Anderson wrote: > > I met a problem > I compiled a native ELF binary running on android arm7 on Ubuntu. > > export GOOS=android > export GOARCH=arm > export GOARM=7 > export CGO_ENABLED=1 > export CGO_CFLAGS="-g -O2 > --sysroot=/mnt/d/sdk/android/android-ndk-r1

[go-nuts] cgo build error

2019-11-03 Thread Bill Anderson
*I met a problem* *I compiled a native ELF binary running on android arm7 on Ubuntu.* export GOOS=android export GOARCH=arm export GOARM=7 export CGO_ENABLED=1 export CGO_CFLAGS="-g -O2 --sysroot=/mnt/d/sdk/android/android-ndk-r14b-linux/android-24/arch-arm" export CGO_LDFLAGS="--sysroot=/mnt/d/

Re: [go-nuts] CGO build error in 1.9

2017-08-29 Thread Ian Lance Taylor
On Tue, Aug 29, 2017 at 3:04 PM, Adrian Sampaleanu wrote: > Hmm, yeah - they're rand() and srand(), respectively. Would've thought these > are standard names. rand and srand are the names defined in the C89 ANSI standard. random and srandom were defined by POSIX.1-2001, based on earlier BSD func

Re: [go-nuts] CGO build error in 1.9

2017-08-29 Thread Adrian Sampaleanu
Hmm, yeah - they're rand() and srand(), respectively. Would've thought these are standard names. On Tuesday, August 29, 2017 at 5:58:17 PM UTC-4, Ian Lance Taylor wrote: > > Is it possible that on the version of GCC you are using with MinGW > that does not declare random and srandom? > > Ian

Re: [go-nuts] CGO build error in 1.9

2017-08-29 Thread Ian Lance Taylor
On Tue, Aug 29, 2017 at 2:24 PM, Adrian Sampaleanu wrote: > > I'm on Windows 10, 64 bit, with MinGW's gcc 7.2.0. The code I pasted isn't > relevant - I just pasted the first example from the Go blog, on cgo, as a > sanity check. I've now checked the "stdio" cgo sample that ships with the Go > dist

Re: [go-nuts] CGO build error in 1.9

2017-08-29 Thread Ian Lance Taylor
On Tue, Aug 29, 2017 at 1:24 PM, Adrian Sampaleanu wrote: > > When running "go build" on the following code: > > package main > > // #include > import "C" > > func Random() int { >return int(C.random()) > } > > func Seed(i int) { >C.srandom(C.uint(i)) > } > > func main() { > } > > > I get