Zookeeper c api installation and Usage Guide

Source: Internet
Author: User

1
Download zookeeper-3.3.6.zip
Compile/zookeeper-3.3.6/src/C
./Configure -- prefix =/HFX/zookeeper
Make
Make install

-- Prefix is similar to this type of parameter,./configure -- Help

After compilation, you can see the following path:

[HFX @ 74 ~] $ CD zookeeper/
[HFX @ 74 zookeeper] $ LL
Total 24
Drwxrwxr-x 2 HFX 4096 Mar 11 Bin
Drwxrwxr-x 3 HFX 4096 Mar 11 16:43 include
Drwxrwxr-x 2 HFX 4096 Mar 11 lib
Indicates that the compilation is successful.

2
Use: add the compiled lib file path to the cmake file. If you need to compile a multi-threaded ClientProgram, Please add the compilation option-dthreaded, and link at the same timeZookeeper_mt LibraryIf you need to compile a single-threaded client programNoAdd the compilation option-dthreaded, which should be linked at the same timeZookeeper_st library.
Include_directories (
./
/Usr/local/include
/Home/HFX/zookeeper/include/C-client-Src
)
 
Link_directories (
/Usr/local/lib
/Home/HFX/zookeeper/lib
)
 
Add_executable (test $ {src_list })
# Add_library (zoo_queue shared $ {src_list })
 
Target_link_libraries (test zookeeper_mt pthread dl)

This protects the compiled lib files.

How to Use zookeeper APIs
For specific APIs, refer to the official website or other blogs. We recommend this:
Http://www.cnblogs.com/haippy/archive/2013/02/21/2920280.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.