简体   繁体   English

无法安装/制作freetds OS X Yosemite

[英]Cannot install/make freetds OS X Yosemite

I am trying to install the gem tiny_tds on my Macbook, so I first tried to install the freetds dependency by running brew install freetds . 我试图在Macbook上安装gem tiny_tds,所以首先尝试通过运行brew install freetds安装freetds依赖项。 However, it doesn't work and I get an error that makes no sense to me : 但是,它不起作用,并且我收到一个对我没有意义的错误:

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

I also tried to compile the freetds from the source, and I also got an error: 我也尝试从源代码编译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

I do not really understand why I cannot compile freetds on my machine and I would be glad if someone helped me ! 我真的不明白为什么我不能在我的机器上编译freetds,如果有人帮助我,我会很高兴!

Thank you in advance. 先感谢您。

I actually found a solution to my problem ! 我实际上找到了解决我问题的方法! Apparently, Libiconv was installed as a dependency to another program by brew. 显然,brew将Libiconv安装为对另一个程序的依赖项。 But this installation was not compiled for my architecture so not working properly. 但是此安装未针对我的体系结构进行编译,因此无法正常工作。 I had to uninstall the brew version of libiconv and reinstall it manually. 我必须卸载libiconv的brew版本并手动重新安装。

brew uninstall libiconv
brew install libiconv
brew install freetds

I am not sure it is necessary to reinstall libiconv via brew as it is supposed to be part of the Mac OS now. 我不确定是否有必要通过brew重新安装libiconv,因为它现在应该是Mac OS的一部分。 Hope this helps people who have the same problem. 希望这对遇到同样问题的人有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM