问题
I installed mingw from their website. I installed the developer package which comes with iconv and intl, msys and all the other stuff.
I run ./configure
and then make install
. While linking, it prints:
../../src/liblzma/liblzma.la -lintl
libtool: link: cannot find the library `/home/keith/staged/mingw32/lib/libiconv.
la' or unhandled argument `/home/keith/staged/mingw32/lib/libiconv.la'
make[2]: *** [xzdec.exe] Error 1
I have no clue who keith is or why it looks there for the library.. I tried settings CCFLAGS CXXFLAGS and LDFLAGS to my include and library folder /usr/local/lib
No cigar.. any ideas why this is happening and how I can fix it?
回答1:
This is a known problem with the MinGW gettext
package. Keith Marshall, the "keith" in question, explains a bit about what's going on in a bug report on the MinGW SourceForge site.
A rather ugly workaround is to actually create a /home/keith/staged/mingw32
folder, then add symlinks to the necessary folders in /mingw
, i.e.:
mkdir -p /home/keith/staged/mingw32
cd $_
ln -s /mingw/bin bin
ln -s /mingw/lib lib
(Note that if /mingw
doesn't exist in your filesystem, you can create it by adding this line to the bottom of /etc/fstab
:
C:/MinGW /mingw
assuming, of course, you have MingW installed in C:\MinGW
. Close the terminal window and re-run msys.bat
for the change to take effect.)
You'll then need to download libiconv.la from a person who has conveniently prepared the file, and copy it to /home/keith/staged/mingw32/lib/
.
It's a terrible hack, but it worked for me.
回答2:
According to this bug report, there is something wrong with the latest gettext package (gettext-0.18.3.2).
I've tried the following 2 ways. It seems both working well.
Remove bad files
pushd /mingw/lib/ && rm libasprintf.la libgettextlib.la libgettextpo.la libgettextsrc.la libintl.la && popd
Or you can just rename them. In fact, you will see /home/keith/... in these *.la files if you open them with text editors.
Use gettext-0.18.3.1 package
Close MSYS and run the following command to use the older version: mingw-get upgrade "gettext=0.18.3.1-1*" , with PATH=C:\mingw\bin;%PATH%, of course.
来源:https://stackoverflow.com/questions/23637991/why-does-building-liblzma-fail-with-cannot-find-the-library