bimg icon indicating copy to clipboard operation
bimg copied to clipboard

go build gopkg.in/h2non/bimg.v1: invalid flag in pkg-config --cflags: -Xpreprocessor

Open jiharal opened this issue 4 years ago • 5 comments

my go env

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/zzz/Library/Caches/go-build"
GOENV="/Users/zzz/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/zzz/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/local/Cellar/go/1.14.2_1/libexec"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14.2_1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/cm/36h2xt1s0tddycbx3wbc1qhw0000gn/T/go-build965641162=/tmp/go-build -gno-record-gcc-switches -fno-common"

jiharal avatar May 06 '20 08:05 jiharal

please try: export CGO_CFLAGS_ALLOW="-Xpreprocessor"

umatomba avatar May 15 '20 06:05 umatomba

please try: export CGO_CFLAGS_ALLOW="-Xpreprocessor"

This worked for me!

Also, may be helpful to note in the READ.me that users must have pkg-config installed.

May be obvious but I ran into an issue, (right before this one), complaining that the "pkg-config" executable could not be found in $PATH.

All I had to do was: brew install pkg-config and then the above mentioned export, and that got me up and running.

Thanks again!

NathanClassen avatar Jun 16 '20 22:06 NathanClassen

All I had to do was: brew install pkg-config and then the above mentioned export, and that got me up and running.

+1, up and running now thanks!

theatlasroom avatar Dec 06 '20 09:12 theatlasroom

Has anyone tried doing this delve ? This runs without delve when I do go run main.go but doesnt work with delve

insaaniManav avatar May 22 '22 14:05 insaaniManav

doesnt

The same to you,have you resolved it?

ABetterCat avatar Jul 27 '22 07:07 ABetterCat