I'm trying to get GO to compile a simple test script on Windows 10 using GoLand but am running into problems. Here is the code:
package main
import "fmt"
import "C"
import (
"math"
)
func main() {
fmt.Println("working")
}
//export add
func add( a , b int) int {
return a + b
}
//export Cosine
func Cosine(x float64) float64 {
return math.Cos(x)
}
When I comment out the import "C"
line the code compiles fine but when its there I get
exec: "gcc": executable file not found in %PATH%
So I installed MinGW and added its bin
to the PATH variable so that in a cmd prompt I can run
C:\GolandProjects\LearnGoProject>gcc
gcc: fatal error: no input files
compilation terminated.
However I'm still getting the error. Could anybody suggest how to fix the issue?