libxml2 iconv 在windows下的生成指南

libxml2 + iconv + msvc 在windows下生成使用库

为了跨平台的解析xml,偶然获得Linux下比较好用的一个xml的解析库libxml2,使用起来确实比较简单,方便;但移植到windows下后发下使用上存在问题:
无法解析格式位GB2312类型的XML文件,但由于一些外部因素,Windows下必须使用GB2312格式
在网上查看了诸多教程,有很多编译生成libxml2库的文章,但都不支持iconv,仔细阅读README后,终于生成了可用的libxml2.lib库,记录下来备用

操作系统:windows 7 x64
版本libiconv-1.15libxml2 Github版本
Visual Studio版本:vs2015
Cygwin:x64

以下操作皆为生成x64位库,32位的基本类似,可以查看具体的README。

一、生成iconv.lib

下载 libiconv-1.xx.tar.gz 在1.15中,需要阅读README.windows,在1.16中需要阅读INSTALL.windows,其余版本的类似,找到windows版本的安装说明。
三种方式可以编译安装libiconv库,我这里使用的是第二种,使用MSVC安装,这个是VS种安装的C/C++工具链,一般都已经安装。

There are three ways to create binaries of this package for Microsoft Windows:

  1. Native binaries, built using the mingw tool chain. 2) Native
  2. binaries, built using the MS Visual C/C++ tool chain. 3) Binaries for
  3. the Cygwin environment.

根据说明:

This recipe requires also a Cygwin environment (with 'bash', the common POSIX
   commands, and 'make') as a build environment. Building with 'nmake' is not
   supported.
   For this, you need to install
     * Cygwin (from https://cygwin.com/),
     * some packages available from the Cy
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值