How to Install Crow C++ on Windows
Marcos Oliveira

Marcos Oliveira @marcosplusplus

About: EN: https://terminalroot.com/ BR: https://terminalroot.com.br/

Location:
Brasil, Paraná
Joined:
May 22, 2024

How to Install Crow C++ on Windows

Publish Date: Jun 20
1 0

🐦‍ Create beautiful, fast, and easy web applications.


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!


📦 Dependencies

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  
Enter fullscreen mode Exit fullscreen mode

Only GCC requires following the tutorial.

Note: After installing it, there's a CMake inside the MinGW folder. To ensure version compatibility, rename cmake 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  
Enter fullscreen mode Exit fullscreen mode

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"  
Enter fullscreen mode Exit fullscreen mode

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  
Enter fullscreen mode Exit fullscreen mode

With that done, let's install Crow C++!


📥 Installing Crow

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"  
Enter fullscreen mode Exit fullscreen mode

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.

ASIO Download

Now, inside your MyProjectCrow folder, clone the Crow repository:

git clone https://github.com/CrowCpp/Crow  
Enter fullscreen mode Exit fullscreen mode

Move the asio folder from your project (MyProjectCrow) into the cloned Crow folder:

Move-Item -Path "asio" -Destination "Crow"  
Enter fullscreen mode Exit fullscreen mode

Then navigate into the Crow folder:

cd Crow  
Enter fullscreen mode Exit fullscreen mode

🛠️ Now Let’s Compile Crow Along with ASIO

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  
Enter fullscreen mode Exit fullscreen mode

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 .  
Enter fullscreen mode Exit fullscreen mode

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  
Enter fullscreen mode Exit fullscreen mode

This --build step is almost insignificant (it doesn’t generate files), but run it just in case:

cmake --build build  
Enter fullscreen mode Exit fullscreen mode

Now, install:

cmake --install build  
Enter fullscreen mode Exit fullscreen mode

It will move files to these paths:

-- 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  
Enter fullscreen mode Exit fullscreen mode

You also need to move the asio/ folder from Crow/ to C:\Includes\:

Move-Item -Path "asio" -Destination "C:\Includes\"  
Enter fullscreen mode Exit fullscreen mode

Finally, exit the Crow folder and delete the cloned repository:

cd ..  
Remove-Item -Path "Crow" -Recurse -Force  
Enter fullscreen mode Exit fullscreen mode

Done! Now let’s test our project!


⚙️ Running a Hello, World! Server with Crow

Now your MyProjectCrow folder is empty. Let’s create a main.cpp file inside it (e.g., using VSCode):

code main.cpp  
Enter fullscreen mode Exit fullscreen mode

Paste this inside:

#include "crow.h"  

int main(){  
    crow::SimpleApp app;  

    CROW_ROUTE(app, "/")([](){  
        return "Hello world";  
    });  

    app.port(18080).multithreaded().run();  
}  
Enter fullscreen mode Exit fullscreen mode

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 an include folder: C:/Includes/asio/include.

g++ main.cpp -I"C:/Includes/asio/include" -I"C:/Includes/crow/include" -lws2_32 -lmswsock -o app.exe  
Enter fullscreen mode Exit fullscreen mode

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.  
Enter fullscreen mode Exit fullscreen mode

It suggests accessing http://0.0.0.0:18080 in your browser, but this may fail. Instead, visit:

http://localhost:18080

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:

Crow running

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:

🎥 Watch the Video

https://youtu.be/5g060xZyj_0


For more information, visit:

Comments 0 total

    Add comment