Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cgo: invalid flag in #cgo CFLAGS: -w #23938

Closed
Aukstkalnis opened this issue Feb 20, 2018 · 2 comments
Closed

cmd/cgo: invalid flag in #cgo CFLAGS: -w #23938

Aukstkalnis opened this issue Feb 20, 2018 · 2 comments

Comments

@Aukstkalnis
Copy link

What did you do?

I tried to build simple gui app using sciter: https://github.com/sciter-sdk/go-sciter

What did you expect to see?

Successful build.

What did you see instead?

cgo error:
github.com/sciter-sdk/go-sciter: invalid flag in #cgo CFLAGS: -w
The terminal process terminated with exit code: 1

With 1.9.4 version there was no such error. I tried using CGO_CFLAGS_ALLOW = 1, but that didn't worked for me.

System details

go version go1.10 windows/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="%USER%\AppData\Local\go-build"
GOEXE=".exe"
GOHOSTARCH="amd64"
GOHOSTOS="windows"
GOOS="windows"
GOPATH="D:\Projects\Go_Projects"
GORACE=""
GOROOT="C:\go"
GOTMPDIR=""
GOTOOLDIR="C:\go\pkg\tool\windows_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=D:\Temp\go-build589517054=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version go1.10 windows/amd64
GOROOT/bin/go tool compile -V: compile version go1.10
lldb --version: lldb version 5.0.0
gdb --version: GNU gdb (GDB) 8.0
@AlexRouSg
Copy link
Contributor

https://github.com/golang/go/wiki/InvalidFlag

Set the environment variable CGO_CFLAGS_ALLOW (or CGO_LDFLAGS_ALLOW, CGO_CXXFLAGS_ALLOW, and so forth) to a regexp that matches the option.

CGO_CFLAGS_ALLOW Is not a boolean, it is a string regexp.

@ianlancetaylor
Copy link
Contributor

Consolidating into #23937.

@mikioh mikioh changed the title CGO: invalid flag in #cgo CFLAGS: -w cmd/cgo: invalid flag in #cgo CFLAGS: -w Feb 21, 2018
@golang golang locked and limited conversation to collaborators Feb 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants