无法安装/制作freetds OS X Yosemite

时间:2014-10-27 14:34:49

标签: ruby-on-rails sql-server homebrew osx-yosemite freetds

我正在尝试在我的Macbook上安装gem tiny_tds,所以我首先尝试通过运行brew install freetds来安装freetds依赖项。但是,它不起作用,我得到一个对我没有意义的错误:

libtool: link: clang -D_THREAD_SAFE -g -O2 -I/usr/local/opt/openssl/include -Wdeclaration-after-statement -o .libs/bsqldb bsqldb.o  -L/usr/local/opt/openssl/lib ../dblib/.libs/libsybdb.dylib ../replacements/.libs/libreplacements.a -lssl -lcrypto /usr/local/Cellar/libiconv/1.13.1/lib/libiconv.dylib
libtool: link: clang -D_THREAD_SAFE -g -O2 -I/usr/local/opt/openssl/include -Wdeclaration-after-statement -o .libs/datacopy datacopy.o  -L/usr/local/opt/openssl/lib ../dblib/.libs/libsybdb.dylib ../replacements/.libs/libreplacements.a -lssl -lcrypto /usr/local/Cellar/libiconv/1.13.1/lib/libiconv.dylib
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

我也尝试从源代码编译freetds,我也遇到了错误:

/bin/sh ../../libtool --tag=CC   --mode=link gcc -D_THREAD_SAFE  -g -O2 -Wdeclaration-after-statement   -o tsql tsql.o ../tds/libtds.la ../replacements/libreplacements.la  -liconv  -lncurses  -lreadline
libtool: link: gcc -D_THREAD_SAFE -g -O2 -Wdeclaration-after-statement -o tsql tsql.o  ../tds/.libs/libtds.a ../replacements/.libs/libreplacements.a /usr/local/Cellar/libiconv/1.13.1/lib/libiconv.dylib -lncurses -lreadline
Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _tds_iconv_open in libtds.a(iconv.o)
      _tds_iconv in libtds.a(iconv.o)
      _tds_iconv_fread in libtds.a(iconv.o)
     (maybe you meant: _tds_iconv_close, _tds_iconv , _tds_iconv_open , _tds_iconv_get , _tds_iconv_free , _tds_iconv_alloc , _tds_iconv_from_collate , _tds_iconv_fread )
  "_iconv_close", referenced from:
      _tds_iconv_open in libtds.a(iconv.o)
      _tds_iconv_info_init in libtds.a(iconv.o)
      _tds_iconv_close in libtds.a(iconv.o)
      _tds_iconv in libtds.a(iconv.o)
      _tds_iconv_get_info in libtds.a(iconv.o)
      _tds_srv_charset_changed_num in libtds.a(iconv.o)
      _tds_set_iconv_name in libtds.a(iconv.o)
      ...
     (maybe you meant: _tds_iconv_close)
  "_iconv_open", referenced from:
      _tds_iconv_open in libtds.a(iconv.o)
      _tds_iconv_info_init in libtds.a(iconv.o)
      _tds_iconv in libtds.a(iconv.o)
      _tds_set_iconv_name in libtds.a(iconv.o)
     (maybe you meant: _tds_iconv_open)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [tsql] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

我真的不明白为什么我不能在我的机器上编译freetds而且如果有人帮助我我会很高兴的!

提前谢谢。

1 个答案:

答案 0 :(得分:1)

我实际上找到了解决问题的方法!显然,Libiconv是作为brew的另一个程序的依赖安装的。但是这个安装没有为我的架构编译,所以不能正常工作。我不得不卸载了libiconv的brew版本并手动重新安装。

brew uninstall libiconv
brew install libiconv
brew install freetds

我不确定是否有必要通过brew重新安装libiconv,因为它现在应该是Mac OS的一部分。希望这可以帮助那些遇到同样问题的人。