vs2010编译iconv1.14

本文详细介绍了如何使用Microsoft Visual Studio 2010专业版编译libiconv 1.14源码,包括获取源码、创建项目、配置编译选项以及修改源文件等步骤,帮助开发者实现根据自己的需求优化编译libiconv。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

代码在github:https://github.com/langresser/iconv1.14-for-vs2010

参考这篇文章:http://www.codeproject.com/Articles/302012/How-to-Build-libiconv-with-Microsoft-Visual-Studio

摘录如下:

Introduction

Libiconv is one of the most useful and famous libraries that converts texts between encodings and has been developed under GNU projects. However, now it does not provide the way to build it with Microsoft Visual Studio but with gcc. Before, it had provided but now stopped explaining how to build it with Microsoft Visual Studio. However, many of the computer programmers are using Microsoft Visual Studio and want to build libiconv with Microsoft Visual Studio. So, this article is about how to build libiconv with Microsoft Visual Studio. If you can buildlibiconv with Microsoft Visual Studio, you will be able to change various compilation options and build it in order to optimize libiconv according to your preference and needs.

Background

If you have no idea about libiconv, you can refer to it here or you can Google for it. You may be confused withiconv and libiconvIconv is the executable program that uses libiconv while libiconv is the library for converting text strings between two different encodings. This article is related to libiconv. However, this article is not about libiconv but about how to build libiconv with Microsoft Visual Studio. The GNU library libiconv is under LGPL license. So, you have to be really careful when you use libiconv for your commercial use or when you don't want to publicize your source code. About LPGL license, you can refer here.

How to Get the Source Code of libiconv

At the moment, the most recent version of libiconv is 1.14. You can download the source code of libiconv1.14 here and here. Of course, you can get the older versions of libiconv here.

How to Build

I am going to explain the case of Microsoft Visual Studio 2010 professional edition but the explanation can be applied to the earlier versions of Microsoft Visual Studio and to the express edition of each of them.

First Step

You download the most recent version of libiconv which is 1.14 from here or here. And unzip the downloaded file "libiconv-1.14.tar.gz" on your certain folder.

Second Step

You run your Microsoft Visual Studio. Then, you make a new WIN32 project. Let's say "libiconv" as the project name. Check to create directory for solution. Choose DLL as the application type and check Empty project for additional options. Click the button "finish" to generate the new project.

Third Step

Now, you have to copy some files from the folders generated by unzipping "libiconv-1.14.tar.gz" to the project folders. To build "libiconv", you need to compile three files "localcharset.c", "relocatable.c" and "iconv.c". That is the key idea!

Copy three files "relocatable.h", "relocatable.c" and "iconv.c" in the folder "...\libiconv-1.14\lib\" to the project folder "...\libiconv\libiconv\".
Copy "...\libiconv-1.14\libcharset\lib\localcharset.c" to the project folder "...\libiconv\libiconv\".
Copy "...\libiconv-1.14\libcharset\include\localcharset.h.build.in" to the project folder "...\libiconv\libiconv\" and then, rename the copied "localcharset.h.build.in" to "localcharset.h.
Copy "...\libiconv-1.14\windows\libiconv.rc" to the project folder "...\libiconv\libiconv\".

Make folder "include" under the project folder "...\libiconv\" so to make "...\libiconv\include". 
Copy "...\libiconv-1.14\include\iconv.h.build.in" to the project include folder "...\libiconv\include" and then, rename the copied "iconv.h.build.in" to "iconv.h".
Copy "...\libiconv-1.14\config.h.in" to the project include folder "...\libiconv\include" and then, rename the copied "c

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值