これは本当に面倒です。闘争からの出力は次のとおりです。
checking for iconv() in iconv.h... no
checking for iconv() in -liconv... no
私のコマンドラインは次のとおりです。
sudo gem install iconv
「どのiconv」が得られます:
/opt/local/bin/iconv
そこにある「チェック中」の行が何を意味するのかさえ、私には本当にわかりません。なぜ地球上で iconv() が iconv.h に存在しないのでしょうか? 私には意味がありません。iconv.h は /opt/local/include にあります。
編集:
mkmf.log からの出力は次のとおりです。
have_func: checking for iconv() in iconv.h... -------------------- no
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/bin/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/bin/lib -L. -arch i386 -arch x86_64 -lruby -lpthread -ldl "
Undefined symbols for architecture i386:
"_libiconv", referenced from:
_libiconv$non_lazy_ptr in ccF0PUYQ.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
_t in cc0k5gYm.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//cc3Rrwkf.out (No such file or directory)
checked program was:
/* begin */
1: #include <iconv.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { void ((*volatile p)()); p = (void ((*)()))iconv; return 0; }
/* end */
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/bin/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/bin/lib -L. -arch i386 -arch x86_64 -lruby -lpthread -ldl "
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'libiconv'
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'libiconv'
lipo: can't figure out the architecture type of: /var/tmp//ccfQKL4Y.out
checked program was:
/* begin */
1: #include <iconv.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { iconv(); return 0; }
/* end */
--------------------
have_library: checking for iconv() in -liconv... -------------------- no
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/bin/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/bin/lib -L. -arch i386 -arch x86_64 -lruby -liconv -lpthread -ldl "
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
_t in ccorhTF7.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccqa9vmd.out (No such file or directory)
checked program was:
/* begin */
1: #include <iconv.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { void ((*volatile p)()); p = (void ((*)()))iconv; return 0; }
/* end */
"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/bin/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/bin/lib -L. -arch i386 -arch x86_64 -lruby -liconv -lpthread -ldl "
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'libiconv'
conftest.c: In function 't':
conftest.c:5: error: too few arguments to function 'libiconv'
lipo: can't figure out the architecture type of: /var/tmp//cc2UrCWJ.out
checked program was:
/* begin */
1: #include <iconv.h>
2:
3: /*top*/
4: int main() { return 0; }
5: int t() { iconv(); return 0; }
/* end */
--------------------