Installing rmagick gem on Windows 8 x64 for Ruby 2.0 x64 - windows-8

I'm trying to install Rmagick gem on Windows 8, Ruby 2.0 - all with 64-bit flavour.
I installed Ruby 2.0 with RubyInstaller - version 2.0.0p247, installed DevKit-mingw64-64-4.7.2-20130224 on top. Then I installed ImageMagic - ImageMagick-6.8.6-4-Q16-x64-dll version, to be exact, with developer headers of course. All are directly on C: drive in respective subfolders without spaces in the names.
Then I try to build a gem.
gem install rmagick --platform=ruby -- --with-opt-lib=c:/ImageMagi
ck-6.8.6-Q16/lib --with-opt-include=c:/ImageMagick-6.8.6-Q16/include
the output is
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
C:/Ruby200-x64/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:/Ruby200-x64/bin/ruby
C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to ge
nerate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:561:in `try_cpp'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1040:in `block in have_header
'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for
'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in p
ostpone'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:306:in `open'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:306:in `open'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:332:in `postpone'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for'
from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1039:in `have_header'
from extconf.rb:194:in `<main>'
Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rmagi
ck-2.13.2 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/ext/RMa
gick/gem_make.out
However i think the problem is not in stdint.h file. I then check a content of file
c:\Ruby200-x64\lib\ruby\gems\2.0.0\gems\rmagick-2.13.2\ext\RMagick\
Which is
checking for Ruby version >= 1.8.5... -------------------- yes
--------------------
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -Ic:/ImageMagick-6.8.6-Q16/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby200-x64/lib -Lc:/ImageMagick-6.8.6-Q16/lib -L. -lCORE_RL_magick_ -lX11 -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
c:/devkit-x64/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/ImageMagick-6.8.6-Q16/lib/X11.lib when searching for -lX11
c:/devkit-x64/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/ImageMagick-6.8.6-Q16/lib/X11.lib when searching for -lX11
c:/devkit-x64/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/ImageMagick-6.8.6-Q16/lib\X11.lib when searching for -lX11
c:/devkit-x64/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lX11
collect2.exe: error: 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 */
which looks like a problem with X11.lib file. It is, of course, located in ImageMagick lib folder, it has a date of 2009, and I have no idea what to do next or what to think about this.
As I'm working with a large files - 6000x6000 pixels I would love to use 64bit versions wherether possible.

I am experiencing the same problem. Using Ruby 2.0.0p247 and gem 2.0.7 with ImageMagick 6.8.6
I have tried with the 32 bit and the 64 bit version of ImageMagick. In both cases, the terminal output is the same:
$ gem install rmagick --platform=ruby -- --with-opt-dir=/c/ImageMagick64
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-opt-dir=c:/ImageMagick64'
This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
c:/Ruby200-x64/bin/ruby.exe extconf.rb --with-opt-dir=c:/ImageMagick64
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
--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:/Ruby200-x64/bin/ruby
c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to ge
nerate an executable file. (RuntimeError)
You have to install development tools first.
from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:561:in `try_cpp'
from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1040:in `block in have_header
'
from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for
'
from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in p
ostpone'
from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:306:in `open'
from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone'
from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:306:in `open'
from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:332:in `postpone'
from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for'
from c:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1039:in `have_header'
from extconf.rb:194:in `<main>'
Gem files will remain installed in c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rmagi
ck-2.13.2 for inspection.
Results logged to c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/ext/RMa
gick/gem_make.out
However, when I use the 32 bit version, the mkmf.log file gives me an error for both CORE_RL_magick_.lib AND X11.lib (incompatible version). When I use the 64 bit version, I only get an error on X11.lib.
This leads me to believe that the X11.lib is bad, maybe a 32 bit version included with their distribution.
My mkmf.log file is as follows:
checking for Ruby version >= 1.8.5... -------------------- yes
--------------------
"x86_64-w64-mingw32-gcc -o conftest.exe -Ic:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -Ic:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -Ic:/Ruby200-x64/include/ruby-2.0.0 -I. -Ic:/ImageMagick64/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -Lc:/Ruby200-x64/lib -Lc:/ImageMagick64/lib -L. -lCORE_RL_magick_ -lX11 -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
c:/ruby200-x64/rubydevkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/ImageMagick64/lib/X11.lib when searching for -lX11
c:/ruby200-x64/rubydevkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/ImageMagick64/lib/X11.lib when searching for -lX11
c:/ruby200-x64/rubydevkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/ImageMagick64/lib\X11.lib when searching for -lX11
c:/ruby200-x64/rubydevkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lX11
collect2.exe: error: 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 */
I know it doesn't necessarily answer the question, but I was able to get the gem built by using the 32 bit version of ruby with the 32 bit ImageMagick library - it "Just Works"

Most likely you have a mismatch between versions:
Ruby x64 will only be able to compile and install rmagick x64
Ruby x86 (32 bit) will only be able to compile and install rmagick x86
Make sure that you install same version of both.

Related

SDL2 doesn't compile on macos Big Sur

In one of my projects I'm using git submodules to download the SDL2 Library and compile it. This is giving me a strange error so I tried to compile SDL2 Standalone and I got the same error.
I'm on a 13" MacBook Pro Big Sur
Steps to reproduce:
git clone https://github.com/libsdl-org/SDL.git
cd SDL
cmake . -Bbuild
make -C ./build
The error I get is
In file included from /Users/<user>/Documents/side side projects/neural networks/libs/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m:24:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
~~~~~~~~~~~~~~ ^ ~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
#define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
^ ~
1 error generated.
make[2]: *** [libs/SDL/CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o] Error 1
make[1]: *** [libs/SDL/CMakeFiles/SDL2.dir/all] Error 2
make: *** [all] Error 2
The message would imply that Apple's own SDK files don't compile, but that can't be right. What's even stranger is that I'm using git submodules with SDL2 in another project but that compiles successfully and I can't find any discernible difference between this and the other project.
Edit:
I user make -C ./build VERBOSE=1 to compare the output with the project that successfully compiled and the project that failed to compile.
Successfully compiled:
[ 0%] Building C object libs/SDL/CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o
cd "/Users/<user>/Documents/side side projects/Legion/build/libs/SDL" && /usr/local/opt/llvm/bin/clang -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -I"/Users/<user>/Documents/side side projects/Legion/build/libs/SDL/include" -I"/Users/<user>/Documents/side side projects/Legion/libs/SDL/include" -g -O3 -idirafter "/Users/<user>/Documents/side side projects/Legion/libs/SDL/src/video/khronos" -D_THREAD_SAFE -msse3 -msse2 -msse -m3dnow -mmmx -Wshadow -fvisibility=hidden -Wdeclaration-after-statement -Werror=declaration-after-statement -fno-strict-aliasing -Wall -fPIC -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks -o CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o -c "/Users/<user>/Documents/side side projects/Legion/libs/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m"
Take note of: -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks
Failed to compile:
[ 0%] Building C object CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o
/usr/local/opt/llvm/bin/clang -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -I/Users/<user>/Desktop/SDL-main/build/include -I/Users/<user>/Desktop/SDL-main/include -idirafter "/Users/<user>/Desktop/SDL-main/src/video/khronos" -I/usr/local/Cellar/libusb/1.0.24/include/libusb-1.0 -D_THREAD_SAFE -msse3 -msse2 -msse -m3dnow -mmmx -Wshadow -fvisibility=hidden -Wdeclaration-after-statement -Werror=declaration-after-statement -fno-strict-aliasing -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -mmacosx-version-min=11.5 -fPIC -o CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o -c /Users/<user>/Desktop/SDL-main/src/file/cocoa/SDL_rwopsbundlesupport.m
Take note of: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk
The only difference between the successfully compiled project and the project that failed to compile is the MacOS SDK version. The one that failed to compile used MacOS SDK 12 while the successful one used MacOS 11.3. Until this is fixed a temporary solution is to downgrade your MacOS SDK to 11.3.

MinGW g++ can't find _G_config.h in same include folder as file including it

I'm trying to do a cross-compile with MinGW g++ and it seems to have selective issues finding files in a system include folder.
It finds stdio.h fine, and finds libio.h fine, but it fails to find _G_config.h even though all three files are in the same folder, with the same permissions, being included in the same way.
Here's the verbose output (unwrapped to make legible; username scrubbed):
-\Documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\arm-linux-gnueabihf-g++.exe -v -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"MainSPI.d" -MT"MainSPI.o" -o "MainSPI.o" "../MainSPI.cpp"
Using built-in specs.
COLLECT_GCC=C:\Users\user-------------\Documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\arm-linux-gnueabihf-g++.exe
Target: arm-linux-gnueabihf
Configured with: /home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/snapshots/gcc-linaro-5.3-2016.02/configure
SHELL=/bin/bash --with-bugurl=https://bugs.linaro.org --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32 --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32 --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32 --with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap --with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-c99 --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-multilib --enable-multiarch --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/sysroots/arm-linux-gnueabihf --enable-lto --enable-linker-build-id --enable-long-long --enable-shared --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran,lto --enable-checking=release --disable-bootstrap --with-bugurl=https://bugs.linaro.org --build=x86_64-unknown-linux-gnu --host=i686-w64-mingw32 --target=arm-linux-gnueabihf --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32
Thread model: posix
gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02)
COLLECT_GCC_OPTIONS='-v' '-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-MMD' '-MP' '-MF' 'MainSPI.d' '-MT' 'MainSPI.o' '-o' 'MainSPI.o' '-shared-libgcc' '-march=armv7-a' '-mtune=cortex-a9' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu'
c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/5.3.1/cc1plus.exe -quiet -v -imultilib . -imultiarch arm-linux-gnueabihf -iprefix c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../lib/gcc/arm-linux-gnueabihf/5.3.1/ -isysroot c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../arm-linux-gnueabihf/libc -MMD MainSPI.d -MF MainSPI.d -MP -MT MainSPI.o -dD -D_GNU_SOURCE ../MainSPI.cpp -quiet -dumpbase MainSPI.cpp -march=armv7-a -mtune=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb -mtls-dialect=gnu -auxbase-strip MainSPI.o -g3 -O0 -Wall -version -fmessage-length=0 -o
C:\Users\user\AppData\Local\Temp\cce7dljB.s
GNU C++ (Linaro GCC 5.3-2016.02) version 5.3.1 20160113 (arm-linux-gnueabihf)
compiled by GNU C version 4.9.1, GMP version 6.0.0, MPFR version 3.1.3,
MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1"
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1/arm-linux-gnueabihf/."
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1/backward"
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/include"
ignoring nonexistent directory "c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../arm-linux-gnueabihf/libc/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32/lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../include/arm-linux-gnueabihf"
ignoring nonexistent directory "c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../arm-linux-gnueabihf/libc/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32/lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../include"
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed"
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include"
#include "..." search starts here:
#include <...> search starts here:
c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1
c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1/arm-linux-gnueabihf/.
c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1/backward
c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../lib/gcc/arm-linux-gnueabihf/5.3.1/include
c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed
c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include
c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../arm-linux-gnueabihf/libc/usr/include/arm-linux-gnueabihf
c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\bin\../arm-linux-gnueabihf/libc/usr/include
End of search list.
GNU C++ (Linaro GCC 5.3-2016.02) version 5.3.1 20160113 (arm-linux-gnueabihf)
compiled by GNU C version 4.9.1, GMP version 6.0.0, MPFR version 3.1.3,
MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: d41011bf5dc0e7b64084b0a5dc2942fd
In file included from c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\arm-linux-gnueabihf\libc\usr\include\stdio.h:75:0,
from ../MainSPI.cpp:4:
c:\users\user-------------\documents\case-sensitive\gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf\arm-linux-gnueabihf\libc\usr\include\libio.h:32:23:
fatal error: _G_config.h: No such file or directory
compilation terminated.
And here's my double checking that yes the files are in the 8th/last search directory:
...abihf/arm-linux-gnueabihf/libc/usr/include$ ls -l _G_config.h stdio.h libio.h
-rwxrwxrwx 1 root root 2526 Jun 19 2017 _G_config.h
-rwxrwxrwx 1 root root 17790 Jun 19 2017 libio.h
-rwxrwxrwx 1 root root 31525 Jun 19 2017 stdio.h
...abihf/arm-linux-gnueabihf/libc/usr/include$ sed -n '32p' libio.h
#include <_G_config.h>
...abihf/arm-linux-gnueabihf/libc/usr/include$ sed -n '75p' stdio.h
#include <libio.h>
I don't think it's relevant but this is on Windows 10 with WSL enabled and I enabled the case sensitive filesystem for the folder case-sensitive.
As for my actual question: Why can't g++ find _G_config.h and how can I fix it so it can?
I am not sure whether this is THE answer. But, I faced a similar situation with Linaro GCC 5.5.0-2017.10 and it turned out to be an issue with the path length on Windows.
This could be the case for you too, as the file that is not being found has a longer name than the two that are found (as it was in my case).
The test is simple, remove some levels from your directory structure (for the purpose of this test) [e.g. by just moving the base folder or your project, or renaming parts of it with a shorter name], and see if the build starts working.

meson not producing any binary files

I have a C project using meson.
The meson file looks like this:
project('camtool', 'c', version : '0.0.1',default_options : ['c_std=c11'])
cxx = meson.get_compiler('c')
systemd_dep = cxx.find_library('systemd')
pthread_dep = cxx.find_library('pthread')
inc = include_directories('include')
subdir('include')
subdir('src')
executable('camtool', './src/test.c',
include_directories : inc,
dependencies : [systemd_dep,pthread_dep])
and my src/test.c looks like this:
#include <stdio.h>
int main() {
// printf() displays the string inside quotation
printf("Hello, World!")
return 0;
}
The output of meson build is:
DEPRECATION: c_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: c_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: cpp_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: cpp_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
Using 'PKG_CONFIG_PATH' from environment with value: '/opt/poky/3.1.6/sysroots/znver1-poky-linux/usr/lib/pkgconfig:/opt/poky/3.1.6/sysroots/znver1-poky-linux/usr/share/pkgconfig'
The Meson build system
Version: 0.56.0
Source dir: /workspaces/quark-v4l2
Build dir: /workspaces/quark-v4l2/build
Build type: cross build
Project name: camtool
Project version: 0.0.1
Using 'CFLAGS' from environment with value: ' -O2 -pipe -g -feliminate-unused-debug-types '
Using 'LDFLAGS' from environment with value: '-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'
Using 'CPPFLAGS' from environment with value: ''
C compiler for the host machine: x86_64-poky-linux-gcc -m64 -march=znver1 -mno-fma -mno-avx -mno-f16c -mno-rdrnd -mno-avx2 -mno-prfchw -mno-bmi -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.6/sysroots/znver1-poky-linux (gcc 9.3.0 "x86_64-poky-linux-gcc (GCC) 9.3.0")
C linker for the host machine: x86_64-poky-linux-gcc -m64 -march=znver1 -mno-fma -mno-avx -mno-f16c -mno-rdrnd -mno-avx2 -mno-prfchw -mno-bmi -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.6/sysroots/znver1-poky-linux ld.bfd 2.34.0.20200220
C compiler for the build machine: cc (gcc 8.3.0 "cc (Debian 8.3.0-6) 8.3.0")
C linker for the build machine: cc ld.bfd 2.31.1
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Library systemd found: YES
Library pthread found: YES
Build targets in project: 1
Found ninja-1.10.0 at /opt/poky/3.1.6/sysroots/x86_64-pokysdk-linux/usr/bin/ninja
After i run meson build, i run find . | grep camtool but it does not find the binary.
Where do i find the binary produced by meson?
Okay, i found out the reason is i misunderstood some steps in meson.
Meson build seems to be a build setting generating the build folder, but not actually building anything.
To make it build, i had to run ninja from the build directory.
Running ninja gave me an error, as my test.c was missing a semicolon.
After adding the semicolon and rerunning ninja, the binary was produced

install Mysql2 -v '0.3.14' for rails 4 error

i want some help to install Mysql2 -v '0.3.14' for rails 4 on windows 7
always after run the command `gem install mysql2 -v '0.3.14'
i always get the error
c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
checking for ruby/thread.h... no
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** 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
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib
Note : when i installed the mysql2 -v 0.2.6 it installed with me well
but i don't know why i get this error with the v 0.3.14
how i solve this issue ??
also when i tried to install it with the command
gem install mysql --platform=ruby -- --with-mysql-include=C:\mysql-connector-c-noinstall-6.0.2-win32\include --with-mysql-lib=C:\mysql-connector-c-noinstall-6.0.2-win32\lib
i got the error
c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb --with-mysql-include=c:mysql-connector-c-noinstall-6.0.2-win32include --with-mysql-lib=mysql-connector-c-noinstall-6.0.2-win32lib
checking for main() in -llibmysql... no
*** 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
--with-mysql-dir
--without-mysql-dir
--with-mysql-include=${mysql-dir}/include
--with-mysql-lib=${mysql-dir}/lib
--with-libmysqllib
--without-libmysqllib
1-first download the mysql-connector-c-6.1.3-win32 from this page
http://dev.mysql.com/downloads/connector/c/
Note : download the ZIP Archive file
2- unZip the file in your c drive to be like that
C:\mysql-connector
3- run the command
$ gem install mysql2 -v 0.3.14 -- '--with-mysql-dir="C:\mysql-connector"'
it should gives you the result
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed mysql2-0.3.14
1 gem installed
Installing ri documentation for mysql2-0.3.14...
Installing RDoc documentation for mysql2-0.3.14...
4- if you got the error mysql2 gem compiled for wrong mysql client library
you need to get the dll file from your connector files
you will find it in the path
C:\mysql-connector\lib\libmysql.dll
then copy it to your Ruby bin folder
you will find it maybe the is path
C:\Ruby200\bin
libmysql.dll is what MySQL2 is looking for. The file is in the lib folder of the MySQL C connector. You can download the connector from "http://dev.mysql.com/downloads/connector/c/" MSI or ZiP, but make sure you get the same architecture 32bit or 64bit. Otherwise you will get an error while installing mySQL2 gem saying "Comparison between signed and unsigned integer expressions" and a whole bunch of 'undefined reference"
Once the connector is downloaded and installed(if you downloaded MSI), open "MySQL Connector C 6.1" where 6.1 is the version number - the folder is in Program Files (Program Files (x86) if you downloaded 32bit version). Go to 'lib' folder and copy 'libmysql.dll' and 'libmysql.lib' and paste them to the 'lib' folder of your mysql server directory like 'C:\MySQL\MySQL_Server_5.6\lib'
then 'gem install mysql -v [version number] -- --with-mysql-dir="C:\MySQL\MySQL_Server_5.6\"'

upgrade to osx lion, bundler gets native extension errors - no such file or directory

I am having a problem that has had me stuck for a day and a half, and I would like some assistance.
I have been moving my latest rails 3 app between my iMac and my macbook pro, with a simple copy, and up till now, I have had no problems.
fyi, I use rvm to manage my project versions.
I got a new iMac, with lion installed, and everything seemed to be good until I ran the bundle update on it. Since then I have not been able to get the bundler to work. The problems crop up when building a gem native extension.
Once I run the bundle update, nothing works on my iMac (osx lion) machine. I can continue to run bundle update on my laptop (Snow Leopard).
So I would like to be able to continue to develop on my Lion machine. Here is what I have done so far:
Initially, I got some errors about my compilers, but since I have reinstalled xcode and run the installer, I no longer those errors.
I still continued to get errors on my nokogiri build. At one point I followed some blog instructions ( and did:
sudo port upgrade --enforce-variants libxml2 +universal
but it seemed to make no difference to building nokogiri.
Now when I do the bundle update, I am getting:
Installing nokogiri (1.5.0) with native extensions /Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile
make
gcc-4.2 -I. -I/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1/x86_64-darwin10.6.0 -I/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1/ruby/backward -I/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1 -I. -DHAVE_XMLHASFEATURE -DHAVE_XMLFIRSTELEMENTCHILD -DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS -DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS -DHAVE_XMLRELAXNGSETVALIDSTRUCTUREDERRORS -DHAVE_XMLSCHEMASETVALIDSTRUCTUREDERRORS -DHAVE_XMLSCHEMASETPARSERSTRUCTUREDERRORS -I/opt/local/include/libxml2 -I/usr/local/include/libxml2 -I/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/include/libxml2 -I/opt/local/include -I/usr/local/include -I/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/include -I/usr/include -I/usr/include/libxml2 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -o html_document.o -c html_document.c
make: gcc-4.2: No such file or directory
make: *** [html_document.o] Error 1
Gem files will remain installed in /Users/tayloredwebsites/.rvm/gems/ruby-1.9.2-p136#current/gems/nokogiri-1.5.0 for inspection.
After doing this waaaay too many times, I decided to remove capybara and lanuchy from my Gemfile, so that I would get past this error. Lo and behold, bundle update gives me another failure to build a native extension:
Installing sqlite3 (1.3.5) with native extensions /Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
creating Makefile
make
gcc-4.2 -I. -I/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1/x86_64-darwin10.6.0 -I/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1/ruby/backward -I/Users/tayloredwebsites/.rvm/rubies/ruby-1.9.2-p136/include/ruby-1.9.1 -I. -DHAVE_RB_PROC_ARITY -DHAVE_SQLITE3_INITIALIZE -DHAVE_SQLITE3_BACKUP_INIT -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -o backup.o -c backup.c
make: gcc-4.2: No such file or directory
make: *** [backup.o] Error 1
So it appears that I am getting a no such file error on my builds, for the same set of code, with the basic difference that one machine is on Lion, and the other is on Snow Leopard.
So maybe someone can help me with these questions:
In my investigations, I noticed that in the nokogiri build, libxml2 is being asked for in 3 places (two of which do not exist!!!!). Anyone know how to control how to control these arguments, so that I can remove the ones that do not exist?
When I looked at the sqlite3 build, I did not notice any missing files, yet I seem to be still getting them. Could this be hung over from the nokogiri problem? If so, does anyone know how I clear these out?
I would like to know what file is missing, and I cant seem to find it in the error message. Is there any way to get debugger detail from the bundle update?
also I noticed that in the make, the include directory contains a directory named with an older version of ruby. This has been this way for quite a while, without any problems, so I suspect this will not be the problem here, but just wanted to point it out.
There is literally no such file or directory gcc-4.2 on Lion. I got stuck on this when trying to "rvm install ruby-1.9.3" which failed similar to what you report. A fix was to specify the CC command like this "CC=gcc rvm install ruby-1.9.3". If the CC=gcc option cannot be passed through to bundler, it might be simpler to "sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2" and just create the symlink it is looking for.
I have reinstalled everything on my OSX Lion. I upgraded to Server to get past some postgres issues. Note when I installed rvm, one of the steps is to run;
$ rvm requirements
which returns, among other things:
Xcode 4.2: * is only supported by ruby 1.9.3+ using command line
flag: --with-gcc=clang * it breaks gems with native extensions,
especially DB drivers.
Xcode 4.2.1+ users - please be warned - in case of any compilation
issues * downgrade to Xcode 4.1 * uninstall Xcode and install
osx-gcc-installer and reinstall your rubies.
Note: if you uninstall Xcode, you lose the standard MacPort Xcode setup.
Note you can build MacPorts from source using gcc - not tried (at least yet).
ln -s /usr/bin/gcc /usr/bin/gcc-4.2
I had built my ruby-1.9.3 with clang so when installing the nokogiri gem I used CC=clang gem install nokogiri -v '1.5.5' which worked for me.