Preface The Boost library is a portable, source-code-provided C++ library that serves as a backup for the standard library and is one of the development engines for the C++ standardization process. The Boost library was initiated by members of the C++ Standards Committee Library Working Group, and some of its content is expected to become the next generation of the C++ Standard Library. It has a great influence in the C++ community and is an authentic "quasi" standard library. Boost is platform-independent because of its emphasis on cross-platform and standard C++. The installation process in Linux is as follows: Go to the official website to download the latest: http://sourceforge.net/projects/boost/files/boost/1.47.0/ or www.boost.org 1. The simplest method: apt-cache search boost Search all boost libraries Then: sudo apt-get install libboost-all-dev Install the corresponding libraries Second, compile and install, You need to download the latest version from the official website. The latest version is 1.47.0 1. After downloading, unzip it to /opt/boost_1_47_0 2. Solve dependencies If it is still not complete, use apt-cache depends XXXXXXX to check 3. Compile bjam: #cd /opt/boost_1_47_0 #sudo ./bootstrap.sh Compilation successful 4. Compile boost #sudo ./bjam Start Compiling It takes about ten minutes. After compilation: The Boost C++ Libraries were successfully built! The following directory should be added to compiler include paths: /home/terry/Local/boost_1_47_0 The following directory should be added to linker library paths: /home/terry/Local/boost_1_47_0/stage/lib Because I unzipped it to /home/terry/Local/boost_1_46_1 So after compiling, it looks like this 5.Update dynamic link library: sudo ldconfig Installation complete 3. Test use: 1. Test code #cat test.cpp #include <boost/lexical_cast.hpp> #include <iostream> int main() { using boost::lexical_cast; int a = lexical_cast<int>("123456"); double b = lexical_cast<double>("123.456"); std::cout << a << std::endl; std::cout << b << std::endl; return 0; } 2. Compile and run --g++ -o test test.cpp #ls test test.cpp # ./test 123456 123.456 Summarize: The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM. You may also be interested in:
|
<<: MySQL replication detailed explanation and simple example
>>: Handwritten Vue2.0 data hijacking example
Table of contents 1. Component Introduction 2. Co...
Table of contents 1. Environmental Preparation 1....
Table of contents 1. Interface effect preview 2.u...
This article introduces a tutorial about how to u...
Table of contents First, configure package.json T...
This article shares a sharing sidebar implemented...
Chinese Tutorial https://www.ncnynl.com/category/...
We deal with Linux servers every day, especially ...
less file name View File less file name | grep -n...
Recently, the company purchased a DELL R730 serve...
Chapter 1 <br />The most important principl...
Locks in MySQL Locks are a means to resolve resou...
Recently, when I turned on my computer, I saw tha...
1. E-Commerce Icons 2. Icon Sweets 2 3. Mobile Ph...
Table of contents 1. Initialization structure 2. ...