bimg
bimg copied to clipboard
Unable to build bimg in Go 1.9.4
System Go 1.9.4 on darwin amd64
vips vips-8.6.2-Wed Jan 31 20:39:14 UTC 2018
bimg v1.0.18 (02e621739c77c791d8c153f240b7a1f75b07816f)
When trying to build anything importing github.com/h2non/bimg
, I receive the following error:
go build github.com/h2non/bimg: invalid flag in pkg-config --cflags: -Wl,-framework
This error is only present in Go 1.9.4 - building is successful with 1.9.3. Any ideas?
Have same issue on Linux with 1.9.4 and 1.8.7. The problem seems caused because of this: https://go.googlesource.com/go/+/867fb18b6d5bc73266b68c9a695558a04e060a8a Issue is already reported: https://github.com/golang/go/issues/23749
I just added a note stating that it is still not working, see: https://github.com/golang/go/issues/23749
I still cannot build anything that imports bimg
since Go 1.10 and the problem still persists in Go 1.11
The error message I get is this:
# go build
go build gopkg.in/h2non/bimg.v1: invalid flag in pkg-config --libs: -Wl,--export-dynamic
@tssajo strange, I'm able to build bimg (v1.0.18
) in Go 1.10 without any issues.
@ryanfowler Hmm... That's interesting! How do you import the bimg
library? I do it this way:
package main
import (
bimg "gopkg.in/h2non/bimg.v1"
)
Also, what OS are you on? I'm on Debian Linux (Jessie), see:
# lsb_release -a
Distributor ID: Debian
Description: Debian GNU/Linux 8.11 (jessie)
Release: 8.11
Codename: jessie
@tssajo I'm using macOS 10.13.6.
The code snippet below compiles for me locally, as well as in a ubuntu:18.04
Docker container with Go 1.10 & 1.11.
package main
import (
"gopkg.in/h2non/bimg.v1"
)
func main() {
_ = bimg.NewImage([]byte(" "))
}
export CGO_LDFLAGS_ALLOW='-Wl,-framework'
https://github.com/golang/go/wiki/InvalidFlag
I am getting similar error
go build github.com/h2non/bimg: invalid flag in pkg-config --cflags: -Xpreprocessor
@sahilpaudel-pe im getting the same issue, with no solution found. Have you found any? Here is my system's info:
# go version
go version go1.16 linux/amd64
# vips --version
vips-8.10.5-Fri Dec 18 10:14:09 UTC 2020
# github.com/h2non/bimg v1.1.15
# lsb_release -a
Distributor ID: Linuxmint
Description: Linux Mint 20.1
Release: 20.1
Codename: ulyssa
@caquillo07 See solution here: https://github.com/h2non/bimg/issues/280
@tssajo thank you, that did the trick! not sure why that didn't come up on my search results.
Cheers 🎉