title: gcc with cygwin 64 installing rbenv
body: <p>Since cygwin has now split into 32 and 64 bit versions, I haven't been able to find a working solution for installing ruby versions with rbenv and ruby-build (a la <a href="https://github.com/sstephenson/rbenv#installation" rel="nofollow">https://github.com/sstephenson/rbenv#installation</a> ), which requires gcc to compile the native extensions.</p>
  
  <p>My machine is Win7 64-bit, and I've now installed the 64-bit cygwin via setup-x86_64.exe and a vanilla installation of rbenv. The of gcc options are now:</p>
  
  <ul>
  <li>cygwin32-gcc</li>
  <li>gcc</li>
  <li>mingw-gcc</li>
  <li>mingw64-i686-gcc</li>
  <li>mingw64-x86_64-gcc</li>
  </ul>
  
  <p>Each of these has multiple subcategories, but for my needs I took only the corresponding core and g++ options. I've tried each in turn via</p>
  
  <pre><code>export CC=/bin/&lt;gcc-executable&gt;
  rbenv install 1.9.3-p0
  </code></pre>
  
  <p>This begins by downloading and attempting to compile yaml. For all but the last of these, the <code>configure</code> phase fails with e.g.</p>
  
  <pre><code>checking whether the C compiler works... no
  configure: error: in `/tmp/ruby-build.20131206180232.7988/yaml-0.1.4':
  configure: error: C compiler cannot create executables
  </code></pre>
  
  <p>(I can dig up those logs if necessary, but I take that to mean that it can't compile an executable for this architechture).</p>
  
  <p>The last one (mingw64-x86_64-gcc) seemed the most promising. It completes the <code>configure</code> phase, but it still fails to compile the yaml module (first module it tries) with the log below.</p>
  
  <p>Any help would be greatly appreciated. I don't think this is an rbenv issue, but rather the symptom of my misconfiguration of gcc.</p>
  
  <p>Full log here:
  <a href="http://pastebin.com/WCukkAWu" rel="nofollow">http://pastebin.com/WCukkAWu</a></p>
  
  <p>But the relevant bits around the failure are:</p>
  
  <pre><code>run-parser.o: In function `main':
  /tmp/ruby-build.20131206180255.6208/yaml-0.1.4/tests/run-parser.c:16: undefined reference to `__imp_yaml_parser_parse'
  /tmp/ruby-build.20131206180255.6208/yaml-0.1.4/tests/run-parser.c:49: undefined reference to `__imp_yaml_event_delete'
  /tmp/ruby-build.20131206180255.6208/yaml-0.1.4/tests/run-parser.c:36: undefined reference to `__imp_yaml_parser_initialize'
  /tmp/ruby-build.20131206180255.6208/yaml-0.1.4/tests/run-parser.c:38: undefined reference to `__imp_yaml_parser_set_input_file'
  /tmp/ruby-build.20131206180255.6208/yaml-0.1.4/tests/run-parser.c:54: undefined reference to `__imp_yaml_parser_delete'
  collect2: error: ld returned 1 exit status
  Makefile:320: recipe for target 'run-parser.exe' failed
  </code></pre>