6. simple use of jsoncpp (2)

Source: Internet
Author: User

1. Notes

In the compilation process, add-L in front of the static library as usual, but the final compilation fails, prompting that the file cannot be found. Later, after being instructed by someone else, instruct-L to remove the file, compiled.

I have added the related path to the lD. So. conf file and executed ldconfig.

The following is taken from [1].

2. Static Library Reference

The-L option tells the compiler where to find the required library file.-L indicates to find it in the current directory. -Lstack tells the compiler to connect to the libstack library, and the-I option tells the compiler where to find the header file. Note: even if the library file is in the current directory, the compiler will not find it by default, so the-L. Option cannot be fewer. The directory that the compiler will find by default can be viewed using the-print-search-dirs option.

3. $ ar Rs libstack. A stack. O push. O pop. O is_empty.o

AR: Creating libstack.

The library file names start with Lib, and the static library uses. A as the suffix, indicating archive. The ar command is similar to the tar command and serves as a package. However, you can only use the AR command instead of the tar command to package the target file into a static library. Option R: Add the following file list to the package. If the package does not exist, create it. If the package already contains a file with the same name, replace it with the new one. S is used to generate a static database, which indicates creating an index for the static database. This index is used by the linker. The ranlib command can also create an index for a static library. The preceding command is equivalent:

$ Ar R libstack. A stack. O push. O pop. O is_empty.o

$ Ranlib libstack.

Reference

[1] Description

Http://www.cnblogs.com/steven_oyj/archive/2010/06/24/1764253.html

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.