Libiconv library installation and static link library compilation instructions

Source: Internet
Author: User

Today, a netizen asked me when he compiled a file, prompted LIBICONV.A file can not find, and then QQ message:

Here is a first premise to explain: for our technical developers, it is advisable to put what is. A, what is. So what's the matter. Lo what is. LA, and their differences with the use of the scene, these basics of patience to add, so that regardless of the installation or expansion of what the library, to be truly comfortable;

On the introduction of a,.so, the follow-up time to elaborate;

Today, with Libiconv. For example, the compilation of the library;

First, we go to the official website or library resource site to download the Libiconv library, such as the following links can be downloaded to different versions of the Libicon Library source package:

http://ftp.gnu.org/pub/gnu/libiconv/

http://mirror.hust.edu.cn/gnu/libiconv/

After downloading, you can extract the library to a directory, such as mine is the CentOS system, I unzipped and put it under the/usr/local/src/;

Then the CD libiconv-1.15 into this directory:

Then follow the three steps of compiling the installation:

Configure

Make

Make install

can complete the installation;

So the important thing is that, in the first step, you need to make a distinction, if you need to. So the dynamic expansion library, then you can directly:

./configure--prefix=/home/work/app/libiconv/(Hint: Please confirm that the/home/work/app/libiconv/directory exists, if it does not exist, you can create it. Of course, you can also install it to any other directory you want to install, if the default does not write--prefix path, will automatically install to the/usr/local below)

The steps are:

1.

./configure--prefix=/home/work/app/libiconv/

2.

Make

3.

Make install

At this time, you go to the/home/work/app/libiconv/directory to view, into its Lib subdirectory, you will see the relevant dynamic library (. So class file)


Accordingly, if you need to compile and install the build static library. A file, it is also three steps, the only difference is in the./configure Steps here:

In this step you need to specify the library type--enable-static--disable-shared, that is:

1.

./configure--prefix=/home/work/app/libiconv/--enable-static--disable-shared

2.

Make

3.

Make install three steps after the installation is successful, similarly, entering the./lib directory, you will see the corresponding static library file (. A class file)
Such as:

[root@dev001-241 lib]# pwd
/home/work/app/libiconv/lib
[root@dev001-241 lib]# Tree
.
├──charset.alias
├──libcharset.a
├──libcharset.la
├──libiconv.a
├──libiconv.la
└──preloadable_libiconv.so

OK, today's introduction to here, thank you;

My QQ:

1760282809

363232564

Welcome a lot of exchanges, progress together.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.