From: Daniel Berger Date: 2011-03-29T06:51:49+09:00 Subject: Re: mkmf have_func usage On Mar 27, 5:21 pm, Albert Schlef wrote: > Ryan Davis wrote in post #989277: > > > On Mar 25, 2011, at 8:19, Iain Barnett wrote: > > >> 7: int t() { iconv_open(); return 0; } > >> /* end */ > > > The error is here and is pretty clear whether it were C or ruby. It > > failed because it wasn't called with the right number of args. > > That's not a very good answer. have_func() is supposed to tell you if a > function exists; so it tries to link to that function. It can't pass > args to the function because it doesn't have any knowledge about the > function. The question is why "mkmf" fails to do this. I know that in C > you don't have to specify correct (or any) arguments to a function (In > C++ it's different). Indeed, I tested this on my Linux box and it works fine with "have_func('iconv_open', '/usr/include/iconv.h')". Based on the output of the mkmf.log file, I suspect a linkage issue. Does it work if you try "have_library('iconv')" or "have_library('libiconv')" first? I'm also curious why those headers are under /Library/Frameworks, but that's another story I suppose. Regards, Dan