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