三条命令:
yum install boost
yum install boost-devel
yum install boost-doc
测试代码:
- #include <iostream>
- #include <boost/filesystem.hpp>
- using namespace boost::filesystem;
- int main(int argc, char *argv[])
- {
- if (argc < 2) {
- std::cout << "Usage: tut1 path ";
- return 1;
- }
- std::cout << argv[1] << " " << file_size(argv[1]) << std::endl;
- return 0;
- }
- g++ test.cpp -o test -lboost_system -lboost_filesystem命令进行编译
- ./test执行