C++boost 라 이브 러 리 의 설치 과정 에 대한 상세 한 설명

2402 단어 C++boost창고.
Windows 설치 boost 라 이브 러 리
다운로드 링크:https://www.boost.org/
학습 링크:https://theboostcpplibraries.com/
1,다운로드 압축 해제,내 디 렉 터 리"C:\Program Files(x86)\\Microsoft Visual Studio\2017"

2.관리자 로"VS 2017 에 적용 되 는 x64 본체 도구 명령 알림"실행
3.다음 명령 을 실행 하여 컴 파일 합 니 다.

cd /d "C:\Program Files (x86)\Microsoft Visual Studio\2017\boost_1_73_0"
bootstrap.bat //         bootstrap.log,      b2.exe,
b2.exe

4,사용

//   :   =》     =》C/C++ =》   =》         :C:\Program Files (x86)\Microsoft Visual Studio\2017\boost_1_73_0
//   :   =》     =》    =》   =》        :C:\Program Files (x86)\Microsoft Visual Studio\2017\boost_1_73_0\stage\lib

#include <iostream>
#include <string>
#include <boost/filesystem.hpp>

using namespace boost::filesystem;

int main(int argc, char* argv[])
{
 std::string file;
 std::cin >> file;
 std::cout << file << " : " << file_size(file) << std::endl;
  
 return 0;
}
Linux 설치 boost 라 이브 러 리
1,압축 풀기 다운로드
2.압축 해제 후 디 렉 터 리 에 들 어가 명령 을 수행 합 니 다.

$ sudo ./bootstrap.sh
$ sudo ./b2 install //     /usr/local/include,    /usr/local/lib
3,사용

#include <iostream> 
#include <boost/filesystem.hpp> 
 
using namespace boost::filesystem; 
 
int main(int argc, char *argv[]) 
{ 
 if (argc < 2)
 { 
  std::cout << "  :app path
"; return 1; } std::cout << argv[1] << ":" << file_size(argv[1]) << std::endl; return 0; } // :g++ TestBoostLib.cpp -o Test -I /usr/local/include -static -L /usr/local/lib -lboost_system -lboost_filesystem
C++boost 라 이브 러 리 의 설치 과정 에 대한 상세 한 설명 은 여기까지 입 니 다.더 많은 C++boost 라 이브 러 리 의 설치 내용 은 예전 의 글 을 검색 하거나 아래 의 관련 글 을 계속 찾 아 보 세 요.앞으로 도 많은 응원 부 탁 드 리 겠 습 니 다!

좋은 웹페이지 즐겨찾기