David A. Fortin
2006-Apr-26 14:00 UTC
[Rails] DB2 under Windows XP - "Missing DB2 Libraries or headers"
I''m trying to get the Ruby DB2 bindings to compile under Windows XP. I''ve been working on this on and off over the last few days with little success. The second step, "ruby setuyp.rb setup" was generating this error message: ABORT: Could not locate DB2 libraries or headers I know I have Db2 installed correctly so I did a little digging and found that the extconf.rb file (in ext/db2) was failing. I''m new to Ruby so digging through the code was an interesting exercise. I finally go it to show me the windows command it was trying to execute: cl -nologo -Feconftest -IC:/Ruby & Rails/ruby-db2-0.4.4/ext/db2 -Ic:/ruby/lib/ruby/1.8/i386-mswin32 "-I"C:/Program Files/IBM/SQLLIB"/include" -I. -I./.. -I./../missing -MD -Zi -O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib db2cli.lib oldnames.lib user32.lib advapi32.lib wsock32.lib -link -libpath:""C:/Program Files/IBM/SQLLIB"/lib" -libpath:"c:/ruby/lib" -stack:0x2000000 After much playing around, I finally got a version that works: cl -nologo -Feconftest -I"C:/Ruby & Rails/ruby-db2-0.4.4/ext/db2" -I"c:/ruby/lib/ruby/1.8/i386-mswin32" -I"C:/Program Files/Microsoft Platform SDK/include" -I"C:/Program Files/IBM/SQLLIB/include" -I. -I"./.." -I"./../missing" -MD -Zi -O2b2x conftest.c msvcrt-ruby18-static.lib db2cli.lib oldnames.lib user32.lib advapi32.lib wsock32.lib -link -libpath:"C:/Program Files/Microsoft Platform SDK/lib" -libpath:"C:/Program Files/IBM/SQLLIB/lib" -libpath:"c:/ruby/lib" -stack:0x2000000 The major differences are in quoting and in missing includes and libraries (I also removed a couple of compile options that are unknown or deprecated). So now my problem is how do I change the code to correctly generate this working command instead of the failing one. At this point, I''m really over my head since the Ruby code is a bit beyond me. Any help (or pointers to a working version) would be appreciated. -- Posted via http://www.ruby-forum.com/.