问题
Hey I know there are a lot of rmagick threads up but I havn't been able to find anything on the current errors I am getting. Everyone gets to the point I am at and it just seems to work for them.
So I have ImageMagick 6.7.1-Q16 installed, I included it in my path without spaces and I installed the c/c++ headers. I have the Dev-Kit properly installed and working I am trying to now install the rmagick gem using this line:
gem install rmagick --platform=ruby -- --with-opt-lib=c:/ImageMagick-6.7.1-Q16/lib -- with-opt-include:/ImageMagick-6.7.1-Q16/include
which I came up with after looking here and at several other places including this post. This seems to have gotten me the farthest but when I run that command it sits for several minutes trying to build the gem and then gives me a huge list of undefined reference errors in all of the .c files inside C:\Ruby192\lib\ruby\gems\1.9.1\gems\rmagick-2.13.1\ext\RMagick/
I can't see all the files it says have reference errors but a few of them are:
rmutil.c undefined reference to 'CloneImageInfo'
rmimage.c undefined reference to 'DestroyExceptionInfo'
rminfo.c undefined reference to 'GetImageOption'
rmmontage.c undefined reference to 'CloneImageInfo'
rmain.c undefined reference to 'SetFatalErrorHandler'
rmpixel.c undefined reference to 'Allocate Image'
rmstruct.c undefined reference to 'CloneString'
there are hundreds of errors but they all seem to reference the same 5-6 resources.
I have been working on this for a day and a half now and am really starting to get frustrated any help would be appreciated.
回答1:
Installing the 32bit version of ImageMagick did the trick for me too.
Also remember to add these env variables:
CPATH=C:\Program Files (x86)\ImageMagick-6.7.9-Q16\include
LIBRARY_PATH=C:\Program Files (x86)\ImageMagick-6.7.9-Q16\lib
回答2:
After doing everything in those posts I did the one thing that none of them mentioned. I went and installed the 32bit version of ImageMagick instead of the 64bit. After doing that I used the same command and it installed. I hope that this helps.
来源:https://stackoverflow.com/questions/7151030/rmagick-not-building-on-windows-7-undefined-reference-errors