樹莓派安裝boost庫

2021-10-08 14:36:03 字數 2991 閱讀 5575

樹莓派: raspberry 3b+

系統版本:noobs version:3.4.0release date:2020-05-27

1、交叉編譯安裝(需要構建其環境,編譯可能是將時間放在大量的試錯、解決編譯過程中的錯誤)。

2、找編譯好的庫安裝。

採用第二個方案,找編譯好的庫安裝。

網上的方法:

raspberry-projects.com

sudo apt-get install libboost1.50-all

中文資源

sudo apt-get install libboost-dev

... 不好使

boost庫有哪些呢,apt-cache搜搜有哪些資源

sudo apt-get update

sudo apt-cache search libboost

列印資訊如下:

libboost-all-dev - boost c++ libraries development files (all) (default version)

libboost-atomic-dev - atomic data types, operations, and memory ordering constraints (default version)

libboost-atomic1.58-dev - atomic data types, operations, and memory ordering constraints

libboost-atomic1.58.0 - atomic data types, operations, and memory ordering constraints

libboost-atomic1.62-dev - atomic data types, operations, and memory ordering constraints

libboost-atomic1.62.0 - atomic data types, operations, and memory ordering constraints

libboost-atomic1.67-dev - atomic data types, operations, and memory ordering constraints

libboost-atomic1.67.0 - atomic data types, operations, and memory ordering constraints

libboost-chrono-dev - c++ representation of time duration, time point, and clocks (default version)

libboost-chrono1.58-dev - c++ representation of time duration, time point, and clocks

libboost-chrono1.58.0 - c++ representation of time duration, time point, and clocks

libboost-chrono1.62-dev - c++ representation of time duration, time point, and clocks

libboost-chrono1.62.0 - c++ representation of time duration, time point, and clocks

libboost-chrono1.67-dev - c++ representation of time duration, time point, and clocks

libboost-chrono1.67.0 - c++ representation of time duration, time point, and clocks

有all,嘿嘿,總能碰上吧.

sudo apt-get install libboost-all-dev
安裝後

# 配置動態庫 不知道是否必須

sudo ldconfig

# aptitude命令沒有,需要apt-get 安裝

aptitude search boost

前面帶 i 的表示已經安裝了。

直接copy別人的**

#include #include #include namespace bpo = boost::program_options;

using namespace std;

int main(int argc, char const *ar**)

catch(...) {

std::cout<

//才能獲取其具體值

std::cout<

g++ -o s main.cpp -lboost_program_options

使用效果

pi@raspberrypi:~/chen_dir/weihua/myoptions $ ./s --help

all options:

--filename arg        the file name which want to be found

--help                this is a program to find a specified file

pi@raspberrypi:~/chen_dir/weihua/myoptions $ ./s --filename s

finds

樹莓派安裝WiringPi庫

wiringpi是乙個樹莓派gpio控制開源庫,安裝後可以使用c語言呼叫相關的函式操作gpio。專案官網 樹莓派gpio管腳定義 注意 若需i2c支援,需要安裝i2c tools libi2c dev sudo apt get install i2c tools sudo apt get insta...

樹莓派安裝

然後把安裝系統的sd卡插入樹莓派進行連線。我沒有顯示器,而且買不起。只能用我的電腦了,樹莓派有三種方式連線電腦 用usb轉串列埠晶元連線樹莓派和電腦,一開始我就是這麼打算的。但是比較無奈的是我用ch340和樹莓派不相容,pl232和win 10相容性太差,一開始是檢測不到 試了好多個驅動後終於檢測到...

樹莓派 無法安裝mysql 樹莓派安裝mysql

前置,更新系統 sudo apt get update sudo apt get upgrade 安裝與配置mysql 因為系統版本不同所以我們要根據自己的系統版本來換相應的源 更換源時,必須先將原來的源複製乙份 cp etc apt sources.list cp etc apt sources....