C + + package management tool Conan use

Source: Internet
Author: User

Installation
sudo pip install conan
Refer to the Demo website
git clone https://github.com/memsharded/example-poco-timer.git mytimer
Command
查看本地库conan search 安装库conan install zlib/[email protected]/stable删除库conan remove zlib/[email protected]/stable
Writing conanfile.txt files
[requires]Poco/[email protected]/stable[generators]gcc
Writing main.cpp source files
 //$Id://poco/1.4/foundation/samples/timer/src/timer.cpp#1 $//This sample demonstrates the Timer and Stopwatch classes.//Copyright (c) 2004-2006, Applied Informatics software Engineering gmbh.//and contributors.//Spdx-li Cense-identifier:bsl-1.0#include "Poco/timer.h" #include "poco/thread.h" #include "poco/stopwatch.h" #include < Iostream>using poco::timer;using poco::timercallback;using poco::thread;using Poco::Stopwatch;class TimerExample        {public:timerexample () {_sw.start ();} void OnTimer (timer& Timer) {std::cout << "Callback called after" << _sw.elapsed ()/1000 <        ;< "milliseconds." << Std::endl; }private:stopwatch _sw;};        int main (int argc, char** argv) {Timerexample example;        Timer timer (250, 500);        Timer.start (timercallback<timerexample> (example, &timerexample::ontimer));        Thread::sleep (5000);        Timer.stop (); return 0;}  
Generate CONANBUILDINFO.GCC conanbuildinfo.txt conaninfo.txt files from conanfile.txt files
conan install .
Using the CONANBUILDINFO.GCC file
GCC Main.cpp-o Main-dboost_use_static_libs-dpoco_static=on-dpoco_no_automatic_libs-i/home/qusir/.conan/data/poco /1.8.0.1/pocoproject/stable/package/8a67b44a092c0074e3cb946a9ddada338054b11e/include-i/home/qusir/.conan/data/ boost/1.66.0/conan/stable/package/eacfdb5f448bfd89f0b2950fb6b7a79e44c7ea08/include-i/home/qusir/.conan/data/ openssl/1.0.2l/conan/stable/package/0abbb2ea17cdc92f4a2ac8a9e55de717e3b5a9d1/include-i/home/qusir/.conan/data/ bzip2/1.0.6/conan/stable/package/76f87539fc90ff313e0b3182641a9bb558a717d2/include-i/home/qusir/.conan/data/ Zlib/1.2.11/conan/stable/package/d358fec34c04bcd89832a09158783c750a3304dc/include-m64-s-dndebug-wl,-rpath= "/ Home/qusir/.conan/data/poco/1.8.0.1/pocoproject/stable/package/8a67b44a092c0074e3cb946a9ddada338054b11e/lib "- Wl,-rpath= "/home/qusir/.conan/data/boost/1.66.0/conan/stable/package/eacfdb5f448bfd89f0b2950fb6b7a79e44c7ea08/ Lib "-wl,-rpath="/home/qusir/.conan/data/openssl/1.0.2l/conan/stable/package/ 0abbb2ea17cdc92f4a2ac8a9e55de717e3b5a9d1/lib "-wl,-rpath="/home/qusir/.conan/data/bzip2/1.0.6/conan/stable/package/ 76f87539fc90ff313e0b3182641a9bb558a717d2/lib "-wl,-rpath="/home/qusir/.conan/data/zlib/1.2.11/conan/stable/ Package/d358fec34c04bcd89832a09158783c750a3304dc/lib "-l/home/qusir/.conan/data/poco/1.8.0.1/pocoproject/stable /package/8a67b44a092c0074e3cb946a9ddada338054b11e/lib-l/home/qusir/.conan/data/boost/1.66.0/conan/stable/ package/eacfdb5f448bfd89f0b2950fb6b7a79e44c7ea08/lib-l/home/qusir/.conan/data/openssl/1.0.2l/conan/stable/ Package/0abbb2ea17cdc92f4a2ac8a9e55de717e3b5a9d1/lib-l/home/qusir/.conan/data/bzip2/1.0.6/conan/stable/package /76f87539fc90ff313e0b3182641a9bb558a717d2/lib-l/home/qusir/.conan/data/zlib/1.2.11/conan/stable/package/ D358fec34c04bcd89832a09158783c750a3304dc/lib-lpocoutil-lpocomongodb-lpoconet-lpoconetssl-lpococrypto-lpocodata -lpocodatasqlite-lpocozip-lpocoxml-lpocojson-lpocofoundation-lpthread-lrt-lboost_wave-lboost_container-lboost_ Exception-lboost_graph-lboost_iostrEams-lboost_locale-lboost_log-lboost_program_options-lboost_random-lboost_regex-lboost_wserialization-lboost_ Serialization-lboost_signals-lboost_coroutine-lboost_context-lboost_timer-lboost_thread-lboost_chrono-lboost_ Date_time-lboost_atomic-lboost_filesystem-lboost_system-lboost_type_erasure-lboost_log_setup-lboost_stacktrace _backtrace-lboost_math_tr1l-lboost_math_tr1f-lboost_stacktrace_basic-lboost_stacktrace_addr2line-lboost_math_ C99f-lboost_math_tr1-lboost_stacktrace_noop-lboost_math_c99l-lboost_math_c99-lboost_unit_test_framework-lssl- Lcrypto-ldl-lbz2-lz-d_glibcxx_use_cxx11_abi=0-lstdc++

is actually adding CONANBUILDINFO.GCC content to the GCC compilation options

Find Remote Libraries
conan remote add conan-transit https://conan-transit.bintray.comconan search --remote conan-transitconan remote add conan-center https://conan.bintray.comconan search --remote conan-center

C + + package management tool Conan use

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.