问题
I'm trying to get MinGW and MSYS working so I can build iconv and libxml2 in Windows, but I'm finding ./configure and make are giving lots of BSD/Unix related errors that aren't specific enough to google, and not descriptive enough for me to figure out. Can anybody go through some of the steps needed to get iconv and libxml2 .dll/.lib built on a Win32 machine?
I'm updating the libraries for some software and I fiddled around with this all day today and haven't figured it out. I got the newest libpng, zlib and curl built with no issues but I see there isn't much support or how-to's for these libraries like there was for the others. Any help would be very appreciated, thanks in advance for your time.
James
回答1:
I realize that I may be reviving a dead thread, but...
Something that worked for me was to not compile the shared libs, instead deriving them using the a2dll tool as follows:
./configure --prefix=/mingw --disable-shared
make
make install
a2dll libiconv.a -o iconv.dll mv -iv iconv.dll /mingw/bin/
回答2:
libxml2 provides JavaScript configure. Look for it in win32 folder. There also is a separate readme file there. Example of building libxml2:
cd win32
cscript.exe configure.js compiler=mingw prefix=D:\soft\Qt\2010.03\mingw debug=yes static=yes
mingw32-make -f Makefile.mingw
I've downloaded prebuilt iconv and it works for me.
回答3:
Environment mingw32
I was able to compile libxml2 with the help of this post
https://mail.gnome.org/archives/xml/2011-December/msg00005.html
Inside the win32
directory of the unzipped http://xmlsoft.org/sources/libxml2-2.9.1.tar.gz
perform 2 steps as below
cscript configure.js threads:no static:yes compiler:mingw iconv:no prefix=where_you_want_to_install include=where_your_mingw_include_is lib=where_your_mingw_lib_is debug=yes
and thenmingw32-make -f Makefile.mingw
I was able to compile and execute http://xmlsoft.org/examples/reader1.c example using code::blocks on mingw with Windows 7 environment.
Remember to specify -lxml2
and -lws2_32
flags in the "Other linker options" box under "Project build options"
回答4:
you can get the binaries for windows made by Igor Zlatkovic at http://www.zlatkovic.com/libxml.en.html
回答5:
you must make clean first then
./configure --host=arm-linux --disable-shared --enable-static CC="arm-linux-gcc" --prefix="/tmp/iconv" --with-configuredir="/tmp/iconv"
make
make install
then at the /tmp/iconv get the libconv.a
回答6:
I have recently found a tutorial from Andrew Marlow (July 2013), explaining briefly how to compile libxml2 under VisualStudio.
The libiconv can be compiled following this complete tutorial, also given as link in the first link.
EDIT
The version 1.14 of libxml2 has now a VS2010 solution. Now it is very simple to do this!
Otherwise, you can follow the readme and Marlow's tutorial to do the same job with other windows specific compilers.
EDIT
I want to write down here some details about the VS2010 solution included with libxml2 v1.14, to help anyone interested. It is pretty badly done; for example, the Release configuration is not properly done at all, you have to do it. If you want to use it, I give you two advices:
Delete first the project iconv if the path is not correct. Then add your project file; you will have still a warning at compilation, due to a reference kept on the old file. To suppress this warning, edit the .vcxproj with a text editor, change the
ProjectReference Include
path of the last ItemGroup with the correct path, AND also theProject
item of this node (replace it with the ProjectGuid of the iconv vcxproj).Link with Ws2_32.lib any application using the static library libxml2.lib.
These are some errors I've been thru, hope this will help anyone who wants to rebuilds libxml2 under VS.
来源:https://stackoverflow.com/questions/3429101/building-the-latest-iconv-and-libxml2-binaries-in-win32