I'd like to compile and test Crow C++ microframework in Debian Linux 11:
Download the latest crow.deb
, currently crow-v1.0+1.deb.
Install it:
$ 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) ...
Create a .cpp
file with a sample code from crowcpp.org:
$ echo '#include "crow.h"
int main()
{
crow::SimpleApp app;
CROW_ROUTE(app, "/")([](){
return "Hello world";
});
app.port(18080).run();
}' > crowtest.cpp
Try to compile it:
$ 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.
See the error above. How can I compile the Crow sample code?
You need to install Boost, for Debian that would be apt install libboost-dev
.