About loading paths for Linux dynamic libraries

Source: Internet
Author: User

Problem

Follow the steps below to compile and install Google Protocol on Ubuntu buffers




Run

There are no errors found for the dynamic library

Reason

The default installation location for protobuf is /usr/local,/usr/local/lib is not the default Ld_library_path of the Ubuntu system in. The question protobuf README.txt to write clearly and blame himself for not being careful.

* * Hint on install location * *

By default, the package would be installed to/usr/local. However,
On many platforms,/usr/local/lib are not part of Ld_library_path.
You can add it, but it is easier to just install TO/USR
instead. To does this, invoke configure as follows:

./configure--PREFIX=/USR

If you already built the package with a different prefix, make sure
To run before building again.

Solve

There are several methods available in the reference article, only one of which is used here.

Method 1:
1. Create a file /etc/ld.so.conf.d/libprotobuf.conf contains content

/usr/local/lib

2. Run the command

Then run protoc--version to get the version number.


Method 2:
    1. Vim/etc/profile
    2. Export ld_library_path=~/protobuf-2.5.0
    3. Source/etc/profile
    4. $ sudo ldconfig

(Ld_library_path Here, fill in the location of the Protobuf file )

About loading paths for Linux dynamic libraries

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.