title: Teradata-cli ruby gem is not getting installed on Windows
body: <p>I am trying to connect to Teradata using ruby script, for which i require teradata-cli ruby gem. But the gem is not getting installed and following error is getting thrown:</p>
  
  <blockquote>
    <p>gem install teradata-cli</p>
  </blockquote>
  
  <pre><code>Temporarily enhancing PATH to include DevKit...
  Building native extensions.  This could take a while...
  ERROR:  Error installing teradata-cli:
          ERROR: Failed to build gem native extension.
  
      C:/Vendor/ruby-2.0.0-p451/bin/ruby.exe extconf.rb
  checking for ruby.h... yes
  checking for main() in -lwincli32... 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:/Vendor/ruby-2.0.0-p451/bin/ruby
          --with-cli-dir
          --without-cli-dir
          --with-cli-include
          --without-cli-include=${cli-dir}/include
          --with-cli-lib
          --without-cli-lib=${cli-dir}/
          --with-wincli32lib
          --without-wincli32lib
  
  extconf failed, exit code 1
  
  Gem files will remain installed in C:/Vendor/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/teradata-cli-0.0.12 for inspection.
  Results logged to C:/Vendor/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0.0/teradata-cli-0.0.12/gem_make.out
  </code></pre>
  
  <p>To resolve above issue, I installed cliv2 on my machine and again tried to install the gem as follows:</p>
  
  <blockquote>
    <p>gem install teradata-cli -- '--with-cli-lib="C:\Teradata_cliv2_x64\Teradata\Client\14.00\CLIv2\lib" --with-cli-include="C:\Teradata_cliv2_x64\Teradata\Client\14.00\CLIv2\inc"'</p>
  </blockquote>
  
  <p>where the lib and include are the directories where Cliv2 client is installed.</p>
  
  <p>Now the error shown above is not thrown but following error is displayed: </p>
  
  <pre><code>C:/Vendor/ruby-2.0.0-p451/bin/ruby.exe extconf.rb --with-cli-lib="C:\Teradata_cliv2_x64\Teradata\Client\14.00\CLIv2\lib" --with-cli-in
  de="C:\Teradata_cliv2_x64\Teradata\Client\14.00\CLIv2\inc"
  checking for ruby.h... yes
  checking for main() in -lwincli32... yes
  creating Makefile
  
  make "DESTDIR=" clean
  
  make "DESTDIR="
  generating cli-i386-mingw32.def
  compiling cli.c
  cli.c: In function 'status_name':
  cli.c:269:17: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:270:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:271:19: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:272:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:273:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:274:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:275:24: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:276:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:277:23: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:278:24: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:279:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:280:26: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:281:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:282:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:283:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:284:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:285:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:286:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:287:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c: In function 'flavor_name':
  cli.c:308:18: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:309:25: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:310:19: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:311:19: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:312:23: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:313:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:314:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:315:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:316:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:317:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:318:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:319:27: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:320:25: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:321:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:322:27: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:323:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:324:24: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:325:17: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:326:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:327:24: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:328:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:329:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:330:23: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:331:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:332:23: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:333:24: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  cli.c:334:19: warning: return discards 'const' qualifier from pointer target type [enabled by default]
  In file included from cli.c:20:0:
  cli.c: At top level:
  C:\Teradata_cliv2_x64\Teradata\Client\14.00\CLIv2\inc/dbcarea.h:270:13: warning: 'D8XIIIRX' defined but not used [-Wunused-variable]
  linking shared-object teradata-cli/cli.so
  cli.o: In function `logoff':
  C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:172: undefined reference to `DBCHCL@12'
  cli.o: In function `cli_cleanup':
  C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:194: undefined reference to `DBCHCLN@8'
  cli.o: In function `cli_initialize':
  C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:100: undefined reference to `DBCHINI@12'
  cli.o: In function `dispatch':
  C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:258: undefined reference to `DBCHCL@12'
  cli.o: In function `logoff':
  C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:172: undefined reference to `DBCHCL@12'
  cli.o: In function `dispatch':
  C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:258: undefined reference to `DBCHCL@12'
  C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:258: undefined reference to `DBCHCL@12'
  C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:258: undefined reference to `DBCHCL@12'
  collect2.exe: error: ld returned 1 exit status
  make: *** [cli.so] Error 1
  
  make failed, exit code 2
  
  Gem files will remain installed in C:/Vendor/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/teradata-cli-0.0.12 for inspection.
  Results logged to C:/Vendor/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0.0/teradata-cli-0.0.12/gem_make.out
  </code></pre>
  
  <p>Please guide how this issue can be resolved.</p>