for a regular go file I say
// +build !windows
however cgo interprets this as c code to get compiled
So what do I have to do?
The build constraint must appear before your package declaration.
Incorrect
package mypackage
// +build !windows
// #include <header.h>
//
// ...
import "C"
Correct
// +build !windows
package mypackage
// #include <header.h>
//
// ...
import "C"