-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
Description
Code in Go file:
package main
/*
#include <stdio.h>
int datspecialnumber() {
return 2015;
}
*/
import "C"
import "fmt"
func main() {
fmt.Println(C.datspecialnumber())
}
Output from go run test.go:
# command-line-arguments
could not determine kind of name for C.datspecialnumber
More info
go version go1.4 linux/amd64
gcc (GCC) 4.9.2 20141224 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/president/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
Anyone have an idea of what is causing this error? Am i doing something wrong?