Compiling duckdb on Windows
2026-02-28
Written by: xiaobin
We recommend using a Clang-based VS Code environment.
File -> Open Folder
Open the root directory
C:\Users\hp262\Documents\duckdb-1.4.4
and Build -> Build All
Open embedded-c++ directory
C:\Users\hp262\Documents\duckdb-1.4.4\examples\embedded-c++
Edit CMakeLists to change the location of the lib directory; Original location:
link_directories(../../build/release/src)
Modified location:
link_directories(../../build/src)
and Build -> Build All
includes C++ CMake tools for Windows
File -> CMake
Open CMakeLists.txt in the root directory
D:\d2b\duckdb-1.4.4\CMakeLists.txt
and Build -> Build All
File -> CMake
Open CMakeLists.txt in the embedded-c++ directory
D:\d2b\duckdb-1.4.4\examples\embedded-c++\CMakeLists.txt
Edit CMakeLists to change the location of the lib directory; Original location:
link_directories(../../build/release/src)
Modified location:
link_directories(../../out/build/x64-Debug/src)
and Build -> Build All
Copy the following files to the same directory:
The output will be displayed at the command prompt:
C:\Users\hp262\Documents>example.exe
i
INTEGER
[ Rows: 1]
3