Gem fails install: cannot find -lCORE_RL_magick_, cannot find -lX11 #42

Closed
bf4 opened this Issue Jul 24, 2014 · 6 comments

Comments

Projects
None yet
3 participants
Owner

bf4 commented Jul 24, 2014

Issue by starrychloe
Sunday Mar 03, 2013 at 20:57 GMT
Originally opened as #70


I'm using RailsInstaller.org. I have DevKit with gcc. Here is my version and path.

C:\Sites\MPay2Park>path
PATH=c:\RailsInstaller\ImageMagick-6.7.9-Q8;C:\RailsInstaller\Ruby1.9.3\bin;C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\bin;C:\RailsInstaller\DevKit\bin;C:\RailsInstaller\Git\cmd;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;c:\Program Files (x86)\AMD APP\bin\x86_64;c:\Program Files (x86)\AMD APP\bin\x86;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\git\cmd;C:\RailsInstaller\DevKit\mingw\bin

C:\Sites\MPay2Park>ruby -v
ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

C:\Sites\MPay2Park>uname -a
MINGW32_NT-6.2 XPS 1.0.17(0.48/3/2) 2011-04-24 23:39 i686 Msys

Here is the error:

C:\Sites\MPay2Park>gem install rmagick -v '2.13.2'
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

        C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/RailsInstaller/Ruby1.9.3/bin/ruby
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file.
(RuntimeError)
You have to install development tools first.
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:254:in `open'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
        from extconf.rb:194:in `<main>'


Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out

Here is the mkmf.log:
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\rmagick-2.13.2\ext\RMagick\mkmf.log

checking for Ruby version >= 1.8.5... -------------------- yes

--------------------

"gcc -o conftest -IC:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.1/i386-mingw32 -IC:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.1/ruby/backward -IC:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.1 -I.     -O3 -fno-omit-frame-pointer -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/RailsInstaller/Ruby1.9.3/lib -L.    -lCORE_RL_magick_ -lX11  -lmsvcrt-ruby191  -lshell32 -lws2_32 -limagehlp  "
c:/railsinstaller/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lCORE_RL_magick_
c:/railsinstaller/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lX11
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main() {return 0;}
/* end */

Owner

bf4 commented Jul 24, 2014

Comment by mmaiza
Monday Mar 04, 2013 at 14:29 GMT


I do not work with windows myself but I will try to help. Also if you google it there are quite a few resources on installing in a windows environment.

It would appear that the imagemagick install has problems since gcc is not able to find the CORE_RL_magick dll. I would trying reinstalling imagemagick use the 32-bit version and make sure that you install it with the development headers (select that option when you install). Also as a precaution do not use spaces in the path names.

You should then be able to install rmagick using something like:

gem install rmagick –platform=ruby -- --with-opt-include=C:\path-to-imagemagick-headers-location –with-opt-include=C:\path-to-imagemagick-dlls-location

it will run for a while and should complete.

Moncef

Owner

bf4 commented Jul 24, 2014

Comment by linduxed
Saturday Nov 02, 2013 at 15:23 GMT


Is this still a problem? If not, this is a candidate for closing, @mmaiza.

Owner

bf4 commented Jul 24, 2014

Comment by cwgabel
Saturday Nov 23, 2013 at 21:26 GMT


Still an issue for me. See: http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=24504&p=105256#p105256

Owner

bf4 commented Jul 24, 2014

Comment by shako
Tuesday Dec 03, 2013 at 08:01 GMT


This is also an issue for me:

path:
C:\pgm\software\ImageMagick-6.8.0-Q16;C:\pgm\devkit\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;c:\Program Files\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files\Common Files\Roxio Shared\DLLShared;c:\Program Files\Common Files\Roxio Shared\DLLShared;c:\Program Files\Common Files\Roxio Shared\9.0\DLLShared;C:\pgm\ruby_193\bin;C:\pgm\software\mysql\bin

ruby version:
ruby 1.9.3p484 (2013-11-22) [i386-mingw32]

mkmf.log:
checking for Ruby version >= 1.8.5... -------------------- yes


"gcc -o conftest -IC:/pgm/ruby_193/include/ruby-1.9.1/i386-mingw32 -IC:/pgm/ruby_193/include/ruby-1.9.1/ruby/backward -IC:/pgm/ruby_193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048 -DFD_SETSIZE=2048 -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/pgm/ruby_193/lib -L. -lCORE_RL_magick_ -lX11 -lmsvcrt-ruby191 -lshell32 -lws2_32 -limagehlp -lshlwapi "
c:/pgm/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lCORE_RL_magick_
c:/pgm/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lX11
collect2: ld returned 1 exit status
checked program was:
/* begin _/
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char *_argv)
6: {
7: return 0;
8: }
/* end */

Owner

bf4 commented Jul 24, 2014

Comment by shako
Tuesday Dec 03, 2013 at 08:15 GMT


I fixed / avoided the problem by installing rmagick with following command:

gem install rmagick --platform=ruby -- --with-opt-lib=C:/pgm/software/ImageMagick-6.8.0-Q16/lib --with-opt-include=C:/pgm/software/ImageMagick-6.8.0-Q16/include

thanks to:

Owner

bf4 commented Jul 24, 2014

Comment by starrychloe
Thursday Dec 26, 2013 at 02:37 GMT


I updated the wiki a while ago for Windows: https://github.com/rmagick/rmagick/wiki

Should probably be easier though.

ioquatix added this to the documentation milestone Sep 7, 2014

linduxed closed this Dec 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment