Crow C++ is a C++ framework for creating HTTP web services or Websockets. It uses routing similar to Flask from Python, making it easy to use.
For more information, watch the video we made about Crow.
The Crow documentation recommends using Conan or vcpkg, but these package managers for C and C++ are not very user-friendly, so…
In this article, we’ll see how to install and run Crow on Windows from scratch—and make it WORK!
Before anything else, you’ll need the following tools installed on your system.
Click the links for installation tutorials on Windows.
Using WinGet, you can install them via PowerShell with these commands:
winget install --id Git.Git -e --source winget
winget install --id=Kitware.CMake -e
winget install --id=MartinStorsjo.LLVM-MinGW.UCRT -e
winget install -e --id Python.Python.3.11 --scope machine
Only GCC requires following the tutorial.
Note: After installing it, there’s a CMake inside the
MinGW
folder. To ensure version compatibility, renamecmake
to something else.
Example: If you run Get-Command cmake
in the terminal, it will show this path:
Get-Command cmake
CommandType Name Version Source
----------- ---- ------- ------
Application cmake.exe 4.0.1.0 C:\mingw64\bin\cmake.exe
So, you need to rename it to ensure it uses the other installation (from Kitware). For example:
Rename-Item -Path "C:\mingw64\bin\cmake.exe" -NewName "DISABLED-cmake.exe"
Now, when you run Get-Command cmake
again, it should show the correct path: C:\Program Files\CMake\bin\cmake.exe
and version:
Get-Command cmake
CommandType Name Version Source
----------- ---- ------- ------
Application cmake.exe 3.26.0.0 C:\Program Files\CMake\bin\cmake.exe
With that done, let’s install Crow C++!
First, create a folder for your Crow project (e.g., on the Desktop
) and navigate into it:
cd "$env:USERPROFILE\Desktop"
New-Item -ItemType Directory "MyProjectCrow"
Set-Location "MyProjectCrow"
Crow depends on the ASIO library at compile-time and runtime, so download ASIO from this link:
Click the Download option as shown in the image:
The current version (as of this article) is
1.30.0
, but if there’s a newer one, choose that.
You’ll be redirected to https://sourceforge.net/projects/asio/files/asio/1.30.2.
On SourceForge, download asio-1.30.2.zip.
After downloading, extract it (Extract Here
), which will create a folder named asio-1.30.2
. Rename it to just asio
.
Cut this asio/
folder and paste it inside your project.
Now, inside your MyProjectCrow
folder, clone the Crow repository:
git clone https://github.com/CrowCpp/Crow
Move the asio
folder from your project (MyProjectCrow
) into the cloned Crow
folder:
Move-Item -Path "asio" -Destination "Crow"
Then navigate into the Crow
folder:
cd Crow
I organize all my includes in a folder on the C:\
drive, similar to how Unix uses /usr/include
. On Windows, I store everything (SFML3, SFML2, tmxlite, FFmpeg, etc.) in C:\Includes
.
So, create this folder and a subfolder C:\Includes\crow
with this command, as we’ll install Crow and ASIO there:
New-Item -Path "C:/Includes/crow" -ItemType Directory
Now, still inside the Crow
folder in your project, compile with this command:
Note the dot (
.
) at the end—it’s important!
cmake -G "Unix Makefiles" -B build -DCMAKE_INSTALL_PREFIX="C:/Includes/crow" -DASIO_INCLUDE_DIR="./asio" -DCMAKE_CXX_FLAGS="-I./asio" -DCROW_BUILD_EXAMPLES=OFF -DCROW_BUILD_TESTS=OFF .
The output should look something like this:
-- The CXX compiler identification is GNU 15.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type selected, default to Release
-- Found Python3: C:/Program Files/Python311/python.exe (found version "3.11.9") found components: Interpreter
-- Found asio: C:/Users/USERNAME/Desktop/MyProjectCrow/Crow/asio
-- Configuring done (13.6s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/USERNAME/Desktop/MyProjectCrow/Crow/build
This --build
step is almost insignificant (it doesn’t generate files), but run it just in case:
cmake --build build
Now, install:
cmake --install build
-- Install configuration: "Release"
-- Installing: C:/Includes/crow/include
-- Installing: C:/Includes/crow/include/crow
-- Installing: C:/Includes/crow/include/crow/app.h
-- Installing: C:/Includes/crow/include/crow/ci_map.h
-- Installing: C:/Includes/crow/include/crow/common.h
-- Installing: C:/Includes/crow/include/crow/compression.h
-- Installing: C:/Includes/crow/include/crow/exceptions.h
-- Installing: C:/Includes/crow/include/crow/http_connection.h
-- Installing: C:/Includes/crow/include/crow/http_parser_merged.h
-- Installing: C:/Includes/crow/include/crow/http_request.h
-- Installing: C:/Includes/crow/include/crow/http_response.h
-- Installing: C:/Includes/crow/include/crow/http_server.h
-- Installing: C:/Includes/crow/include/crow/json.h
-- Installing: C:/Includes/crow/include/crow/logging.h
-- Installing: C:/Includes/crow/include/crow/middleware.h
-- Installing: C:/Includes/crow/include/crow/middlewares
-- Installing: C:/Includes/crow/include/crow/middlewares/cookie_parser.h
-- Installing: C:/Includes/crow/include/crow/middlewares/cors.h
-- Installing: C:/Includes/crow/include/crow/middlewares/session.h
-- Installing: C:/Includes/crow/include/crow/middlewares/utf-8.h
-- Installing: C:/Includes/crow/include/crow/middleware_context.h
-- Installing: C:/Includes/crow/include/crow/mime_types.h
-- Installing: C:/Includes/crow/include/crow/multipart.h
-- Installing: C:/Includes/crow/include/crow/multipart_view.h
-- Installing: C:/Includes/crow/include/crow/mustache.h
-- Installing: C:/Includes/crow/include/crow/parser.h
-- Installing: C:/Includes/crow/include/crow/query_string.h
-- Installing: C:/Includes/crow/include/crow/returnable.h
-- Installing: C:/Includes/crow/include/crow/routing.h
-- Installing: C:/Includes/crow/include/crow/settings.h
-- Installing: C:/Includes/crow/include/crow/socket_acceptors.h
-- Installing: C:/Includes/crow/include/crow/socket_adaptors.h
-- Installing: C:/Includes/crow/include/crow/task_timer.h
-- Installing: C:/Includes/crow/include/crow/TinySHA1.hpp
-- Installing: C:/Includes/crow/include/crow/utility.h
-- Installing: C:/Includes/crow/include/crow/version.h
-- Installing: C:/Includes/crow/include/crow/websocket.h
-- Installing: C:/Includes/crow/include/crow.h
-- Installing: C:/Includes/crow/lib/cmake/Crow/CrowTargets.cmake
-- Installing: C:/Includes/crow/lib/cmake/Crow/Findasio.cmake
-- Installing: C:/Includes/crow/lib/cmake/Crow/CrowConfig.cmake
You also need to move the asio/
folder from Crow/
to C:\Includes\
:
Move-Item -Path "asio" -Destination "C:\Includes\"
Finally, exit the Crow
folder and delete the cloned repository:
cd ..
Remove-Item -Path "Crow" -Recurse -Force
Done! Now let’s test our project!
Hello, World!
Server with CrowNow your MyProjectCrow
folder is empty. Let’s create a main.cpp
file inside it (e.g., using VSCode):
code main.cpp
Paste this inside:
#include "crow.h"
int main(){
crow::SimpleApp app;
CROW_ROUTE(app, "/")([](){
return "Hello world";
});
app.port(18080).multithreaded().run();
}
Save the file, return to the terminal, and compile your project with this command:
Confirm these paths, as you may have subfolders. Inside
asio
, there should be aninclude
folder:C:/Includes/asio/include
.
g++ main.cpp -I"C:/Includes/asio/include" -I"C:/Includes/crow/include" -lws2_32 -lmswsock -o app.exe
This will generate .\app.exe
. Run it:
You’ll see this:
.\app.exe
(2025-06-20 03:58:29) [INFO ] Crow/master server is running at http://0.0.0.0:18080 using 2 threads
(2025-06-20 03:58:29) [INFO ] Call `app.loglevel(crow::LogLevel::Warning)` to hide Info level logs.
It suggests accessing http://0.0.0.0:18080 in your browser, but this may fail. Instead, visit:
The address
0.0.0.0
is a placeholder meaning “all network interfaces”—so the server listens on all your computer’s interfaces, but it’s not a valid IP to access directly in a browser.
You’ll see this message in the browser:
To stop the server, press
Ctrl + C
in the terminal.
Everything is working!
I’ve been doing many things with Crow, like this Tasks++/ToDO++
using Crow C++, Databases, HTMX, and TailwindCSS:
webdev windows cpp crowcpp web