$ cc -o conftest -g -I/usr/local/include -L/usr/local/lib conftest.c
-lm -ltermlib -lelf -lnsl -lsocket -liconv
"conftest.c", line 192: warning: statement not reached
This sounds like a bug with the linker for not erroring out when it
can't link against the libraries it has been told to link with. I tried
that test locally (Linux system, so gcc) and the compile/link failed.
Just on the offchance...is the problem that /usr/local/lib is given
there with an -L option, so found while compiling/linking, but isn't in
your LIBPATH, so isn't being searched by ld at runtime? It's a bit of a
long shot, as I would expect a lot more to be broken if there are a
bunch of libs in /usr/local/lib not being found, but it's worth
checking.
Or is there a libiconv.so somewhere else on your system being found at
compile/link time, but not at runtime? Maybe that's more likely. Your
error message included a full filename (not just 'iconv'), which
suggests the linker found a file by that name at some stage. Where did
it find it, and why can't it find it at runtime?
It seems to me that the correct solution is to *not* include -liconv
unless libiconv.so is actually present (and working). I'm not sure how
to achieve that with autoconf-style programs. The function being used
in this case is ac_fn_c_try_link() which has the following comment:
One could change configure to try and run the program, but that's
generally to be avoided since it inhibits cross-compiling.
Shouldn't the configure test just test for iconv headers and not include
the library if there are no headers? Whether cross compiling or not,
your development environment should be such that headers for installed
(on the target system) libraries are available, and headers for
non-installed libraries are not. If you have a situation where libiconv
is not installed, but you have headers floating around, you should trash
the headers (or install the library!).
Ben.
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php