我想在 Debian Linux 11 中編譯和測驗 Crow C 微框架:
下載當前最新
crow.deb的crow-v1.0 1.deb。安裝它:
$ sudo dpkg -i crow-v1.0 1.deb Selecting previously unselected package crow. (Reading database ... 587955 files and directories currently installed.) Preparing to unpack crow-v1.0 1.deb ... Unpacking crow (1.0 1) ... Setting up crow (1.0 1) ...使用來自crowcpp.org
.cpp的示例代碼創建一個檔案:$ echo '#include "crow.h" int main() { crow::SimpleApp app; CROW_ROUTE(app, "/")([](){ return "Hello world"; }); app.port(18080).run(); }' > crowtest.cpp嘗試編譯它:
$ g crowtest.cpp -lpthread In file included from /usr/include/crow.h:2, from crowtest.cpp:1: /usr/include/crow/query_string.h:9:10: fatal error: boost/optional.hpp: No such file or directory 9 | #include <boost/optional.hpp> | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.請參閱上面的錯誤。如何編譯 Crow 示例代碼?
uj5u.com熱心網友回復:
您需要安裝 Boost,對于 Debian,它將是apt install libboost-dev.
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/463691.html
