Import C error in Golang: cc1.exe: error: too many filenames given

This is my code:

package main

import (
    "C"
    "fmt"
    "unsafe"
)

func main() {
    c := 1
    var Cvar C.int = 1
    cup := unsafe.Pointer(&c)
    cbyte := C.GoBytes(cup, Cvar)
    fmt.Printf("%x", cbyte)
}

I am trying to import and use C package but I keep getting this error while compiling:

# runtime/cgo
cc1.exe: error: too many filenames given.  Type cc1.exe --help for usage
cc1.exe: fatal error: Files/Win-builds/include: No such file or directory
compilation terminated.
exit status 2
Process exiting with code: 1

on windows 64 bit these are my go verions and gcc version:

gcc --version
gcc (GCC) 4.8.3
Copyright © 2013 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.

go version
go version go1.14 windows/amd64

What am I missing here that it throws me this error?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.