How to Use protobuf in Linux

Source: Internet
Author: User


 

I will not go into details about the usage instructions in many places. Here I will only talk about some details, that is, what I made a mistake.

I checked a lot of information today and did not solve the problem. I am writing it now to help the troubled people.

1.About the library file path

/Configure

Make check

Make install

After three commands, the installation is complete.

After the installation, run protoc and the system prompts that two libraries cannot be found: libprotobuf. so and libprotoc. so. The reason is that these two libraries are installed under/usr/local/lib, but the lib path of the UT is/usr/lib. Some systems use usr/lib as the library file directory, and some systems use usr/local/lib as the library directory

 

You can modify the environment variable by modifying the profile of the etc (system level) or home (user level. A file in source can be used directly without restarting.

This setting can contain two types of lib

LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/lib:/usr/local/lib

Export
LD_LIBRARY_PATH

 

2. Import the header file "XX. h ";Remember to add;

 

3. enumTo ";"Separate, instead ","

Related Article

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.