Building the latest iconv and libxml2 binaries in Win32
Asked Answered
E

6

7

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

Eccentricity answered 7/8, 2010 at 4:9 Comment(0)
T
3

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/

Tryparsamide answered 16/5, 2011 at 2:46 Comment(0)
U
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 then
mingw32-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"

Unbeatable answered 7/5, 2014 at 21:12 Comment(0)
F
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.

Fronton answered 7/8, 2010 at 7:53 Comment(3)
Basilevs, Thanks, this did work for libxml2, but as for iconv I wanted to get the latest 1.13.1 and build that one, but wasn't able to find them anywhere. I tried using the ones available on Sourceforge with MinGW (sourceforge.net/downloads/mingw/MinGW/libiconv/libiconv-1.13.1) but couldn't get those to work without doing some hacky stuff to change the iconv.dll naming conventions.Eccentricity
I had to do this and eventually got it to work. However, make sure you use mingw32-make and not make. For whatever reason, the two behaved differently for me. Might of had a path issue, but it's working now so I'll leave it be.Symbolize
@Jason, the reason is that make is for MSYS environment, whereas mingw32-make is for native console.Concomitance
J
1

you can get the binaries for windows made by Igor Zlatkovic at http://www.zlatkovic.com/libxml.en.html

Jhelum answered 9/8, 2010 at 4:4 Comment(1)
Aaragorn, I did see those binaries, but they are older than the ones I currently have, he only has 1.9.2, I was hoping for a newer version. I understand it may work fine with an older version of the .dll but I was trying to avoid the dependency of relying on pre-built .dlls and try to build my own. I've accepted the compromise and will use an older version, although I'd still like to figure out how to build iconv on win32. Cygwin and MinGW/MSYS failed for me even after many tries and workarounds.Eccentricity
S
0

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

Stribling answered 14/11, 2011 at 5:50 Comment(0)
D
0

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:

  1. 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 the Project item of this node (replace it with the ProjectGuid of the iconv vcxproj).

  2. 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.

Doralynne answered 26/2, 2014 at 10:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.