Linux installation Libevent

Source: Internet
Author: User

Install libevent under Ubuntu today, download the source code

    1. TAR-XZVF libevent-1.4.15.tar.gz
    2. CD libevent-1.4.15
    3. ./configure
    4. Make
    5. Make install #可能需要sudo

Automatically installed under the/usr/local/lib directory, if the following link is wrong, or if the compiler successfully ran the executable prompt can ' t open share object something, please add in ~/.profile

Export ld_library_path=/usr/local/lib: $LD _library_pathexport libdir=/usr/local/lib: $LIBDIR #export LD_LIBRARY_PATH =export ld_run_path=:/usr/local/lib: $LD _RUN_PATH#GCC Find the path to the header file #export c_include_path=/usr/include/libxml2:/mylib#g + + Find the path to the header file export cplus_include_path= $CPLUS _include_path:~/workspace/boost_1_60_0# Find the path to the dynamic link library export Ld_library_ Path=/usr/local/lib: $LD _library_path# Find the path to the static library export library_path=/usr/local/lib: $LIBRARY _path

I look at the changes, compile files, such as I want to compile libevent under the test/directory time-test.c file

Bash input (gcc Connect command-l to last):

GCC time-test.c-levent

Note that the compilation command I used earlier is

Causes the compilation does not pass, prompts many Libevent API function undefined, looked for half a day reason only then discovers, slightly pits ~

Linux installation Libevent

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.