Skip to content

cmd/cgo: could not determine kind of name for C.datspecialnumber #9733

@ghost

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions