我正在關注此文檔以構建 Go Imagick 庫。當我運行以下命令時go build -tags no_pkgconfig imagick它拋出以下異常:# imagicksrc/imagick/affine_matrix.go:8:29: fatal error: wand/MagickWand.h: No such file or directorycompilation terminated現在要解決這個問題,我還安裝了以下軟件包,因為許多人建議解決該錯誤。但它也沒有奏效。sudo apt-get install libmagickwand-dev libmagickcore-dev imagemagick此外,當我運行go build imagick 它時會引發以下錯誤:# imagickcould not determine kind of name for C.FlattenAlphaChannelcould not determine kind of name for C.RemoveAlphaChannel輸出 pkg-config --cflags --libs MagickWand給出了正確的輸出-fopenmp -I/usr/include/ImageMagick -lMagickWand -lMagickCoreImageMagick 僅安裝到此路徑(/usr/include/ImageMagick)。
2 回答
慕仙森
TA貢獻1827條經驗 獲得超8個贊
他們的文件提到的是no_pkgconfig必須手動設置使用GCO_CFLAGS和CGO_LDFLAGS。所以這樣的事情應該有效:
export CGO_CFLAGS="$(pkg-config --cflags MagickWand)"
export CGO_LDFLAGS="$(pkg-config --libs MagickWand)"
go build -tags no_pkgconfig
- 2 回答
- 0 關注
- 406 瀏覽
添加回答
舉報
0/150
提交
取消
