I'm trying to run the cgo sample
(http://golang.org/doc/articles/c_go_cgo.html) on an ARM build (Raspberry
Pi). I've built the same code on an x86 machine without issues.
When running 'go install' I run into this import error
# randy
randy/randy.go:5: can't find import: "github.com/steve918/rand"
The import paths are correct so I try to build just the imported bit and it
seems to work (fails silently), but if I run cgo manually with -debug-gcc I
see something like the following. It appears to fail while compiling a
test because of an unnamed variable declaration.
void __cgo__f__(void) {
#line 0 "cgo-test"
unsigned int; enum { _cgo_enum_0 = unsigned int }; /* cgo-test:0 */
srandom; enum { _cgo_enum_1 = srandom }; /* cgo-test:1 */
random; enum { _cgo_enum_2 = random }; /* cgo-test:2 */
}
EOF
cgo-test: In function '__cgo__f__':
cgo-test:0:1: error: useless type name in empty declaration [-Werror]
cgo-test:0:36: error: expected expression before 'unsigned'
cgo-test:1:1: error: statement with no effect [-Werror=unused-value]
cgo-test:1:31: error: enumerator value for '_cgo_enum_1' is not an integer
constant
cgo-test:2:1: error: statement with no effect [-Werror=unused-value]
cgo-test:2:30: error: enumerator value for '_cgo_enum_2' is not an integer
constant
cc1: all warnings being treated as errors
$ gcc -Wall -Werror -o_obj/_cgo_.o -gdwarf-2
-fno-eliminate-unused-debug-types -c -xc - <<EOF
Anyone seen something like this before?
--