Using the Boost library under the Linux platform

Source: Internet
Author: User


1. After the boost is compiled, the boost header file is best copied to/usr/include, or there is a link under/usr/include.

Library files in stage/lib/libboost_* are best copied to/usr/lib.

This allows you to run with g++ without specifying-i$boost_include and-l$boost_lib.

2. Running

g++ main.cpp SourceLine.cpp Filetravel.cpp-i$boost_include-l$boost_lib-lboost_filesystem

The following error occurred:

FileTravel.cpp:In member function? OID Filetravel::getsubfiles (Std::vector<std::basic_string<char, Std::char_traits<char>, std:: Allocator<char>, Std::allocator<std::basic_string<char, Std::char_traits<char>, std:: allocator<char> > > >&)?.

Filetravel.cpp:27:error:invalid conversion from?. Ool (*) (const std::string&)?. To? oid*?

filetravel.cpp:27:error:initializing argument 2 of?. OOST::FILESYSTEM3::p ath::p ath (const source&, typename Boost::enable_if<boost::filesystem3::p Ath_traits::is _pathable<typename boost::d ecay<source>::type>, void>::type*) [With Source = std::basic_string< Char, Std::char_traits<ch ' ar>, std::allocator<char>;]?

The above appears "? "And so garbled to see what the error is, modified Xshell default language into Utf-8,

g++ main.cpp SourceLine.cpp Filetravel.cpp-lboost_filesystem-lboost_thread

is operating normally.

3. Summary: Boost is a good library, but the g++ link is relatively complex lock, which library to specify which library to look like, in the end which libraries need this designation, waiting time with a longer conclusion.


This article is from the "quiet and Far" blog, please be sure to keep this source http://peacefulmind.blog.51cto.com/4778867/1575538

Using the Boost library under the Linux platform

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.