gographics / imagick

Go binding to ImageMagick's MagickWand C API
https://godoc.org/github.com/gographics/imagick/imagick
Other
1.75k stars 182 forks source link

'MagickWand/MagickWand.h' file not found #286

Closed codebarz closed 1 year ago

codebarz commented 1 year ago

I'm trying to create a sample PDF to image converter but I get this error while run the code

# gopkg.in/gographics/imagick.v3/imagick
/Users/tega/go/pkg/mod/gopkg.in/gographics/imagick.v3@v3.4.2/imagick/affine_matrix.go:8:10: fatal error: 'MagickWand/MagickWand.h' file not found
#include <MagickWand/MagickWand.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

I installed ImageMagick using Mac ports command sudo port install ImageMagick

this is the code below

package main

import "gopkg.in/gographics/imagick.v3/imagick"

func main() {
    imagick.Initialize()
    defer imagick.Terminate()
    mw := imagick.NewMagickWand()
    defer mw.Destroy()
    mw.ReadImage("proof.pdf")
    mw.SetIteratorIndex(0) // This being the page offset
    mw.SetImageFormat("jpg")
    mw.WriteImage("test.jpg")
}

But I seem to get the error. Kindly help with a fix for this.

justinfx commented 1 year ago

The problem isn't with your code. During compilation, ImageMagick7 cannot be found. Can you check which version Macports installed by running something like convert -version? If it gave you ImageMagick 6.x then you need to be using the v2 version of this library instead of v3.

codebarz commented 1 year ago

The problem isn't with your code. During compilation, ImageMagick7 cannot be found. Can you check which version Macports installed by running something like convert -version? If it gave you ImageMagick 6.x then you need to be using the v2 version of this library instead of v3.

Hello @justinfx , thanks for you reply. This is the version of imagemagick installed on my Mac.

Version: ImageMagick 6.9.11-60 Q16 arm 2021-01-25 https://imagemagick.org

But as soon as I switch to V2, I get a bunch of errors. Its longer but this is it

Colors , __cgo_3df9851dabdf_Cfunc_MagickGetImage , __cgo_3df9851dabdf_Cfunc_MagickGetImageArtifacts , __cgo_3df9851dabdf_Cfunc_MagickGetImageFilename , __cgo_3df9851dabdf_Cfunc_MagickGetImageBlob , __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelFeatures , __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelRange , __cgo_3df9851dabdf_Cfunc_MagickGetImageInterlaceScheme , __cgo_3df9851dabdf_Cfunc_MagickGetImageCompressionQuality , __cgo_3df9851dabdf_Cfunc_MagickGetImageGravity , __cgo_3df9851dabdf_Cfunc_MagickGetImageDistortion , __cgo_3df9851dabdf_Cfunc_MagickGetImageRenderingIntent , __cgo_3df9851dabdf_Cfunc_MagickGetImageHistogram , __cgo_3df9851dabdf_Cfunc_MagickGetImageIterations , __cgo_3df9851dabdf_Cfunc_MagickGetImageWidth , __cgo_3df9851dabdf_Cfunc_MagickGetImageCompression , __cgo_3df9851dabdf_Cfunc_MagickGetImageResolution , __cgo_3df9851dabdf_Cfunc_MagickGetImageColormapColor , __cgo_3df9851dabdf_Cfunc_MagickGetImageGamma , __cgo_3df9851dabdf_Cfunc_MagickGetImageClipMask , __cgo_3df9851dabdf_Cfunc_MagickGetImageAlphaChannel , __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelKurtosis , __cgo_3df9851dabdf_Cfunc_MagickGetImageRedPrimary , __cgo_3df9851dabdf_Cfunc_MagickGetImageWhitePoint , __cgo_3df9851dabdf_Cfunc_MagickGetImageSignature , __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelDistortion , __cgo_3df9851dabdf_Cfunc_MagickGetImageBorderColor )
  "_MagickGetImageAlphaChannel", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageAlphaChannel in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageAlphaChannel)
  "_MagickGetImageArtifact", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageArtifact in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageArtifact, __cgo_3df9851dabdf_Cfunc_MagickGetImageArtifacts )
  "_MagickGetImageArtifacts", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageArtifacts in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageArtifacts)
  "_MagickGetImageBackgroundColor", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageBackgroundColor in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageBackgroundColor)
  "_MagickGetImageBlob", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageBlob in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageBlob)
  "_MagickGetImageBluePrimary", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageBluePrimary in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageBluePrimary)
  "_MagickGetImageBorderColor", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageBorderColor in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageBorderColor)
  "_MagickGetImageChannelDepth", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelDepth in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelDepth)
  "_MagickGetImageChannelDistortion", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelDistortion in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelDistortions, __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelDistortion )
  "_MagickGetImageChannelDistortions", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelDistortions in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelDistortions)
  "_MagickGetImageChannelFeatures", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelFeatures in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelFeatures)
  "_MagickGetImageChannelKurtosis", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelKurtosis in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelKurtosis)
  "_MagickGetImageChannelMean", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelMean in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelMean)
  "_MagickGetImageChannelRange", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelRange in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelRange)
  "_MagickGetImageChannelStatistics", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelStatistics in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageChannelStatistics)
  "_MagickGetImageClipMask", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageClipMask in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageClipMask)
  "_MagickGetImageColormapColor", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageColormapColor in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageColormapColor)
  "_MagickGetImageColors", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageColors in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageColorspace, __cgo_3df9851dabdf_Cfunc_MagickGetImageColors )
  "_MagickGetImageColorspace", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageColorspace in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageColorspace)
  "_MagickGetImageCompose", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageCompose in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageCompose)
  "_MagickGetImageCompression", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageCompression in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageCompressionQuality, __cgo_3df9851dabdf_Cfunc_MagickGetImageCompression )
  "_MagickGetImageCompressionQuality", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageCompressionQuality in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageCompressionQuality)
  "_MagickGetImageDelay", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageDelay in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageDelay)
  "_MagickGetImageDepth", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageDepth in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageDepth)
  "_MagickGetImageDispose", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageDispose in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageDispose)
  "_MagickGetImageDistortion", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageDistortion in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageDistortion)
  "_MagickGetImageEndian", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageEndian in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageEndian)
  "_MagickGetImageFilename", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageFilename in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageFilename)
  "_MagickGetImageFormat", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageFormat in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageFormat)
  "_MagickGetImageFuzz", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageFuzz in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageFuzz)
  "_MagickGetImageGamma", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageGamma in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageGamma)
  "_MagickGetImageGravity", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageGravity in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageGravity)
  "_MagickGetImageGreenPrimary", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageGreenPrimary in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageGreenPrimary)
  "_MagickGetImageHeight", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageHeight in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageHeight)
  "_MagickGetImageHistogram", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageHistogram in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageHistogram)
  "_MagickGetImageInterlaceScheme", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageInterlaceScheme in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageInterlaceScheme)
  "_MagickGetImageInterpolateMethod", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageInterpolateMethod in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageInterpolateMethod)
  "_MagickGetImageIterations", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageIterations in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageIterations)
  "_MagickGetImageLength", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageLength in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageLength)
  "_MagickGetImageMatteColor", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageMatteColor in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageMatteColor)
  "_MagickGetImageOrientation", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageOrientation in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageOrientation)
  "_MagickGetImagePage", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImagePage in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImagePage)
  "_MagickGetImagePixelColor", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImagePixelColor in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImagePixelColor)
  "_MagickGetImageProfile", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageProfile in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageProfiles, __cgo_3df9851dabdf_Cfunc_MagickGetImageProfile )
  "_MagickGetImageProfiles", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageProfiles in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageProfiles)
  "_MagickGetImageProperties", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageProperties in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageProperties)
  "_MagickGetImageProperty", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageProperty in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageProperty)
  "_MagickGetImageRedPrimary", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageRedPrimary in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageRedPrimary)
  "_MagickGetImageRegion", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageRegion in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageRegion)
  "_MagickGetImageRenderingIntent", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageRenderingIntent in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageRenderingIntent)
  "_MagickGetImageResolution", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageResolution in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageResolution)
  "_MagickGetImageScene", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageScene in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageScene)
  "_MagickGetImageSignature", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageSignature in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageSignature)
  "_MagickGetImageTicksPerSecond", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageTicksPerSecond in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageTicksPerSecond)
  "_MagickGetImageTotalInkDensity", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageTotalInkDensity in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageTotalInkDensity)
  "_MagickGetImageType", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageType in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageType)
  "_MagickGetImageUnits", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageUnits in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageUnits)
  "_MagickGetImageVirtualPixelMethod", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageVirtualPixelMethod in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageVirtualPixelMethod)
  "_MagickGetImageWhitePoint", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageWhitePoint in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageWhitePoint)
  "_MagickGetImageWidth", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImageWidth in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImageWidth)
  "_MagickGetImagesBlob", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetImagesBlob in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetImagesBlob)
  "_MagickGetInterlaceScheme", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetInterlaceScheme in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetInterlaceScheme)
  "_MagickGetInterpolateMethod", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetInterpolateMethod in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetInterpolateMethod)
  "_MagickGetIteratorIndex", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetIteratorIndex in 000046.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetIteratorIndex)
  "_MagickGetNumberImages", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetNumberImages in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetNumberImages)
  "_MagickGetOption", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetOption in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetOptions, __cgo_3df9851dabdf_Cfunc_MagickGetOption )
  "_MagickGetOptions", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetOptions in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetOptions)
  "_MagickGetOrientation", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetOrientation in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetOrientation)
  "_MagickGetPackageName", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetPackageName in 000045.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetPackageName)
  "_MagickGetPage", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetPage in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetPage)
  "_MagickGetPointsize", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetPointsize in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetPointsize)
  "_MagickGetQuantumDepth", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetQuantumDepth in 000045.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetQuantumDepth)
  "_MagickGetQuantumRange", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetQuantumRange in 000045.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetQuantumRange)
  "_MagickGetReleaseDate", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetReleaseDate in 000045.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetReleaseDate)
  "_MagickGetResolution", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetResolution in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetResolution)
  "_MagickGetResource", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetResource in 000045.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetResource, __cgo_3df9851dabdf_Cfunc_MagickGetResourceLimit )
  "_MagickGetResourceLimit", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetResourceLimit in 000045.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetResourceLimit)
  "_MagickGetSamplingFactors", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetSamplingFactors in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetSamplingFactors)
  "_MagickGetSize", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetSize in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetSize, __cgo_3df9851dabdf_Cfunc_MagickGetSizeOffset )
  "_MagickGetSizeOffset", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetSizeOffset in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetSizeOffset)
  "_MagickGetType", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetType in 000050.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetType)
  "_MagickGetVersion", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickGetVersion in 000045.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickGetVersion)
  "_MagickHaldClutImage", referenced from:
      __cgo_3df9851dabdf_Cfunc_MagickHaldClutImage in 000049.o
     (maybe you meant: __cgo_3df9851dabdf_Cfunc_MagickHaldClutImageChannel, __cgo_3df9851dabdf_Cfunc_MagickHaldClutImage )
...
justinfx commented 1 year ago

v2 would be the right version of this library then. You are picking up a newer version of ImageMagick 6 than it seems we have tested but I would think it should still work. The error you are getting seems like some kind of cached issue. Can you try running go clean? It might be still seeing objects from that previous attempt on the wrong ImageMagick.

codebarz commented 1 year ago

Still same after running go clean

justinfx commented 1 year ago

I've just tested this on my M1 mac, using the v2 bindings and installing ImageMagick6 from homebrew:

$ brew install 'imagemagick@6'

$ export PATH="/opt/homebrew/opt/imagemagick@6/bin:$PATH"
$ export PKG_CONFIG_PATH="/opt/homebrew/opt/imagemagick@6/lib/pkgconfig" 

$ convert -version
Version: ImageMagick 6.9.12-67 Q16 aarch64 17519 https://legacy.imagemagick.org

$ go build

So I am not sure if its the specific version installed by ports, or still some cached objects. Try also clearing caches and not just the build artifacts?

go clean -cache
go clean -modcache
codebarz commented 1 year ago

Hey @justinfx , seems like the issue is with my configuration. Just tried on another Mac and it worked. Thanks for your support

justinfx commented 1 year ago

Alright. Thanks for confirming.