Here's how you can install Crow on your favorite GNU/Linux distro.
- C++ compiler with at least C++11 support.
- Asio development headers (1.10.9 or later).
- (optional) ZLib for HTTP Compression.
- (optional) OpenSSL for HTTPS support.
- (optional) CMake for building tests, examples, and/or installing Crow.
- (optional) Python3 to build tests and/or examples.
Crow's CI uses
clang-10.0 running on AMD64 (x86_64) and ARM64v8 architectures.
Using a package Manager¶
You can install Crow on GNU/Linux as a pre-made package
Simply download Crow's
.deb file from the release section and Install it.
Crow is available for Arch based distros through the AUR package
Crow provides an archive containing the framework and CMake files, just copy the
include folder to
lib folder to
You can also download the
crow_all.h file and simply include that into your project.
Installing from source¶
- Download Crow's source code (Either through Github's UI or by using
git clone https://github.com/CrowCpp/Crow.git).
mkdir buildinside of crow's source directory.
- Navigate to the new "build" directory and run the following:
cmake .. -DCROW_BUILD_EXAMPLES=OFF -DCROW_BUILD_TESTS=OFF
You can ignore
-DCROW_BUILD_EXAMPLES=OFF -DCROW_BUILD_TESTS=OFF if you want to build the Examples and Unit Tests.
While building you can set the
CROW_FEATURES variable (as a
; separated list). You can use an argument such as
You can uninstall Crow at a later time using
Crow can be installed manually on your Linux computer.
Multiple header files¶
include directory to your project's
include directory to the
Single header (crow_all.h)¶
crow_all.h is recommended only for small, possibly single source file projects, and ideally should not be installed on your system.
navigate to the
scripts directory and run
./merge_all.py ../include crow_all.h. This will generate a
crow_all.h file that you can use in your projects.
You can also include or exclude middlewares from your
crow_all.h by using
-e followed by the middleware header file names separated by a comma (e.g.
merge_all.py ../include crow_all.h -e cookie_parser to exclude the cookie parser middleware).
Compiling your project¶
In order to get your CMake project to work with Crow, all you need are the following lines in your CMakeLists.txt:
target_link_libraries(your_project PUBLIC Crow::Crow)
For optional features like HTTP Compression or HTTPS you can set the
CROW_FEATURES variable using lines such as
set(CROW_FEATURES ssl compression), or
Directly using a compiler¶
All you need to do is run the following command:
g++ main.cpp -lpthread
-DCROW_ENABLE_COMPRESSION -lz for HTTP Compression, or
-DCROW_ENABLE_SSL -lssl for HTTPS support, or even replace g++ with clang++.