-
Notifications
You must be signed in to change notification settings - Fork 279
Question about how to install ruby-odbc from ruby 2.4 (msys64) on Windows 7 #94
Description
This project is for Ruby version 2.4 and newer.
For Ruby versions < 2.4 please file an issue here.
What problems are you experiencing?
Fail to install ruby-odbc from MSYS64.
$ gem install ruby-odbc
ERROR: Error installing ruby-odbc:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-odbc-0.99998/ext
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20180111-9528-u9x9a6.rb extconf.rb
checking for version.h... yes
checking for sql.h... yes
checking for sqlext.h... yes
checking for SQLTCHAR in windows.h,sqltypes.h... yes
checking for SQLLEN in windows.h,sqltypes.h... yes
checking for SQLULEN in windows.h,sqltypes.h... yes
checking for odbcinst.h... yes
checking for SQLROWOFFSET in windows.h,sqltypes.h... yes
checking for odbcinst.h... yes
checking for SQLROWSETSIZE in windows.h,sqltypes.h... yes
checking for odbcinst.h... yes
checking for () in -lodbc32... no
checking for () in -lodbccp32... no
checking for () in -luser32... no
creating Makefile
current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-odbc-0.99998/ext
make "DESTDIR=" clean
current directory: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-odbc-0.99998/ext
make "DESTDIR="
generating odbc-x64-mingw32.def
compiling init.c
compiling odbc.c
In file included from C:/Ruby24-x64/include/ruby-2.4.0/ruby/win32.h:41:0,
from C:/Ruby24-x64/include/ruby-2.4.0/ruby/defines.h:243,
from C:/Ruby24-x64/include/ruby-2.4.0/ruby/ruby.h:36,
from C:/Ruby24-x64/include/ruby-2.4.0/ruby.h:33,
from odbc.c:21:
C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
#warning Please include winsock2.h before windows.h
^~~~~~~
linking shared-object odbc.so
odbc.o:odbc.c:(.text+0x1ee): undefined reference to SQLError' odbc.o:odbc.c:(.text+0x748): undefined reference to SQLExecute'
odbc.o:odbc.c:(.text+0x818): undefined reference to SQLDisconnect' odbc.o:odbc.c:(.text+0x1950): undefined reference to SQLFetchScroll'
odbc.o:odbc.c:(.text+0x1968): undefined reference to SQLFetch' odbc.o:odbc.c:(.text+0x1990): undefined reference to SQLExecDirect'
odbc.o:odbc.c:(.text+0x19b0): undefined reference to SQLPrepare' odbc.o:odbc.c:(.text+0x19ff): undefined reference to SQLTables'
odbc.o:odbc.c:(.text+0x1a4f): undefined reference to SQLColumns' odbc.o:odbc.c:(.text+0x1a8e): undefined reference to SQLPrimaryKeys'
odbc.o:odbc.c:(.text+0x1ade): undefined reference to SQLStatistics' odbc.o:odbc.c:(.text+0x1afc): undefined reference to SQLGetTypeInfo'
odbc.o:odbc.c:(.text+0x1b71): undefined reference to SQLForeignKeys' odbc.o:odbc.c:(.text+0x1bae): undefined reference to SQLTablePrivileges'
odbc.o:odbc.c:(.text+0x1bee): undefined reference to SQLProcedures' odbc.o:odbc.c:(.text+0x1c3f): undefined reference to SQLProcedureColumns'
odbc.o:odbc.c:(.text+0x1c97): undefined reference to SQLSpecialColumns' odbc.o:odbc.c:(.text+0x1ce7): undefined reference to SQLDriverConnect'
odbc.o:odbc.c:(.text+0x1d2e): undefined reference to SQLConnect' odbc.o:odbc.c:(.text+0x1de1): undefined reference to SQLReadFileDSN'
odbc.o:odbc.c:(.text+0x1f0d): undefined reference to SQLWriteFileDSN' odbc.o:odbc.c:(.text+0x1f84): undefined reference to SQLEndTran'
odbc.o:odbc.c:(.text+0x22c1): undefined reference to SQLCancel' odbc.o:odbc.c:(.text+0x23ae): undefined reference to SQLDescribeParam'
odbc.o:odbc.c:(.text+0x24da): undefined reference to SQLNumParams' odbc.o:odbc.c:(.text+0x2eda): undefined reference to SQLAllocStmt'
odbc.o:odbc.c:(.text+0x2fb9): undefined reference to SQLSetEnvAttr' odbc.o:odbc.c:(.text+0x300b): undefined reference to SQLGetEnvAttr'
odbc.o:odbc.c:(.text+0x30de): undefined reference to SQLRowCount' odbc.o:odbc.c:(.text+0x4c25): undefined reference to SQLColAttributes'
odbc.o:odbc.c:(.text+0x4cc0): undefined reference to SQLColAttributes' odbc.o:odbc.c:(.text+0x4d58): undefined reference to SQLColAttributes'
odbc.o:odbc.c:(.text+0x4dd7): undefined reference to SQLColAttributes' odbc.o:odbc.c:(.text+0x4e54): undefined reference to SQLColAttributes'
odbc.o:odbc.c:(.text+0x4ec8): more undefined references to SQLColAttributes' follow odbc.o:odbc.c:(.text+0x5345): undefined reference to SQLConfigDataSource'
odbc.o:odbc.c:(.text+0x58d3): undefined reference to SQLError' odbc.o:odbc.c:(.text+0x5a32): undefined reference to SQLGetData'
odbc.o:odbc.c:(.text+0x5f2d): undefined reference to SQLGetData' odbc.o:odbc.c:(.text+0x6343): undefined reference to SQLColAttributes'
odbc.o:odbc.c:(.text+0x640f): undefined reference to SQLColAttributes' odbc.o:odbc.c:(.text+0x6594): undefined reference to SQLColAttributes'
odbc.o:odbc.c:(.text+0x668d): undefined reference to SQLColAttributes' odbc.o:odbc.c:(.text+0x71e3): undefined reference to SQLFreeStmt'
odbc.o:odbc.c:(.text+0x727f): undefined reference to SQLColAttributes' odbc.o:odbc.c:(.text+0x72c6): undefined reference to SQLColAttributes'
odbc.o:odbc.c:(.text+0x7358): undefined reference to SQLColAttributes' odbc.o:odbc.c:(.text+0x738d): undefined reference to SQLColAttributes'
odbc.o:odbc.c:(.text+0x7504): undefined reference to SQLNumResultCols' odbc.o:odbc.c:(.text+0x77e2): undefined reference to SQLFreeEnv'
odbc.o:odbc.c:(.text+0x78cb): undefined reference to SQLFreeConnect' odbc.o:odbc.c:(.text+0x790c): undefined reference to SQLFreeConnect'
odbc.o:odbc.c:(.text+0x79f9): undefined reference to SQLNumParams' odbc.o:odbc.c:(.text+0x7af9): undefined reference to SQLNumResultCols'
odbc.o:odbc.c:(.text+0x7b4e): undefined reference to SQLFreeStmt' odbc.o:odbc.c:(.text+0x7d51): undefined reference to SQLMoreResults'
odbc.o:odbc.c:(.text+0x7eea): undefined reference to SQLAllocStmt' odbc.o:odbc.c:(.text+0x852a): undefined reference to SQLFreeStmt'
odbc.o:odbc.c:(.text+0x8685): undefined reference to SQLFreeStmt' odbc.o:odbc.c:(.text+0x86e6): undefined reference to SQLFreeStmt'
odbc.o:odbc.c:(.text+0x87e1): undefined reference to SQLAllocStmt' odbc.o:odbc.c:(.text+0x8912): undefined reference to SQLFreeStmt'
odbc.o:odbc.c:(.text+0x8984): undefined reference to SQLFreeStmt' odbc.o:odbc.c:(.text+0x89e1): undefined reference to SQLFreeStmt'
odbc.o:odbc.c:(.text+0x8a19): undefined reference to SQLAllocStmt' odbc.o:odbc.c:(.text+0x8dcd): undefined reference to SQLFreeConnect'
odbc.o:odbc.c:(.text+0x9733): undefined reference to SQLAllocEnv' odbc.o:odbc.c:(.text+0x9868): undefined reference to SQLAllocConnect'
odbc.o:odbc.c:(.text+0x9a4d): undefined reference to SQLFreeConnect' odbc.o:odbc.c:(.text+0x9bdc): undefined reference to SQLAllocConnect'
odbc.o:odbc.c:(.text+0x9cd5): undefined reference to SQLAllocConnect' odbc.o:odbc.c:(.text+0x9da9): undefined reference to SQLFreeConnect'
odbc.o:odbc.c:(.text+0x9ee5): undefined reference to SQLDrivers' odbc.o:odbc.c:(.text+0xa1e5): undefined reference to SQLDataSources'
odbc.o:odbc.c:(.text+0xa41f): undefined reference to SQLSetCursorName' odbc.o:odbc.c:(.text+0xa4b8): undefined reference to SQLGetCursorName'
odbc.o:odbc.c:(.text+0xa729): undefined reference to SQLGetInfo' odbc.o:odbc.c:(.text+0xa7a0): undefined reference to SQLGetInfo'
odbc.o:odbc.c:(.text+0xa8e7): undefined reference to SQLGetInfo' odbc.o:odbc.c:(.text+0xacef): undefined reference to SQLBindParameter'
odbc.o:odbc.c:(.text+0xb3a6): undefined reference to SQLFreeStmt' odbc.o:odbc.c:(.text+0xb3d7): undefined reference to SQLFreeStmt'
odbc.o:odbc.c:(.text+0xb48c): undefined reference to SQLFreeStmt' odbc.o:odbc.c:(.text+0xb57b): undefined reference to SQLFreeStmt'
odbc.o:odbc.c:(.text+0xb5ea): undefined reference to SQLFreeStmt' odbc.o:odbc.c:(.text+0xb9ef): undefined reference to SQLSetStmtOption'
odbc.o:odbc.c:(.text+0xbb1d): undefined reference to SQLGetConnectOption' odbc.o:odbc.c:(.text+0xbc19): undefined reference to SQLSetConnectOption'
odbc.o:odbc.c:(.text+0xbce2): undefined reference to SQLGetStmtOption' odbc.o:odbc.c:(.text+0x714): undefined reference to SQLCancel'
odbc.o:odbc.c:(.text+0x724): undefined reference to SQLCancel' odbc.o:odbc.c:(.text+0x734): undefined reference to SQLCancel'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:259: odbc.so] Error 1
make failed, exit code 2
Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ruby-odbc-0.99998 for inspection.
Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/ruby-odbc-0.99998/gem_make.out
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
Steps to reproduce
$ ruby -v
ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]
$ gem install ruby-odbc
What's the output from ridk version?
ruby:
path: C:/Ruby24-x64
version: 2.4.3
platform: x64-mingw32
ruby_installer:
package_version: 2.4.3-1
git_commit: 36aac73
msys2:
path: C:\msys64
title: MSYS2 64bit
version: '20161025'
cc: x86_64-w64-mingw32-gcc (Rev1, Built by MSYS2 project) 7.2.0
sh: GNU bash, version 4.4.12(1)-release (x86_64-pc-msys)
os: Microsoft Windows [Version 6.1.7601]