GitRead 中文社区
首页趋势排行榜原创文章严选周刊
更多资源
新手训练营
精选专题热门话题GitHub 文档资源精选实战指南

xtd

Free open-source modern C++20 framework to create console (CLI), forms (GUI like WinForms) and unit test (xUnit) applications and libraries on Windows, macOS, Linux, iOS, Android, FreeBSD, Haiku, and SerenityOS.

  • 语言C++
  • 默认分支master
  • 大小2.7 GB
  • 更新12 小时前
  • Issues99
在 GitHub 打开
avatargammasoft71

项目介绍

gammasoft71/xtd 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 MIT License 许可证,目前获得 1.2k 个 Star、79 次 Fork。

仓库全名
gammasoft71/xtd

README 摘要

xtd Write Once, Run Everywhere! xtd (pronounced "extend") is a modern C++20/23 framework to create console (CLI), forms (GUI) and unit test (xUnit) multiplatform applications and libraries. Latest news xtd 1.0.0 will require C++20 as the minimum standard - Posted on June 15, 2025 Release xtd 0.1.2 (beta) - Posted on March 12, 2024 The xtd 1.0.0 is growing - Posted on November 12, 2023 Release xtd 0.1.1 (beta) -…

完整内容见 GitHub 原始 README 或本页 。

常见问题

xtd 用什么语言开发?

主要使用 C++ 编写,采用 MIT License 许可证,目前有 1.2k 个 Star。

xtd 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 xtd 的源码?

可以直接克隆仓库:git clone https://github.com/gammasoft71/xtd.git,默认分支为 master;安装与运行步骤见仓库 README。

xtd 最近还在维护吗?

仓库最近一次更新为 12 小时前,当前有 99 个未关闭 Issue;Star 数为 1.2k,可作为社区活跃度的参考。

本页面展示项目元数据与原始 README,GitRead 中文社区 编辑团队负责选题收录。

相关仓库

tensorflow/tensorflow avatar
tensorflowtensorflow
8 小时前
201.4k
78.2k
3.4k

面向所有人的开源机器学习框架

deep-learningdeep-neural-networksdistributed+5
C++
1.4 GB
0
详情
ggml-org/llama.cpp avatar
llama.cppggml-org
2 小时前
133.8k
21.3k
737

C/C++ 中的大语言模型推理

ggml
C++
480.3 MB
3
详情
react/react-native avatar
react-nativereact
8 小时前
126.9k
25.5k
1.4k

使用 React 构建原生应用的框架

androidapp-frameworkcross-platform+5
C++
970.4 MB
0
详情
electron/electron avatar
electronelectron
9 小时前
123.8k
17.9k
780

使用 JavaScript、HTML 和 CSS 构建跨平台桌面应用

electronjavascriptc-plus-plus+6
C++
227.6 MB
0
详情
godotengine/godot avatar
godotgodotengine
2 天前
119.9k
26.8k
13.4k

Godot Engine – 多平台 2D 和 3D 游戏引擎

game-developmentgame-enginegamedev+4
C++
1.8 GB
0
详情
microsoft/terminal avatar
terminalmicrosoft
2 天前
105.4k
9.6k
1.7k

新的 Windows Terminal 和原始的 Windows 控制台主机,全都集中在这里!

cmdcommand-lineconsole+8
C++
177.4 MB
0
详情
opencv/opencv avatar
opencvopencv
11 小时前
91.5k
57.1k
2.9k

开源计算机视觉库

opencvc-plus-pluscomputer-vision+2
C++
558.2 MB
0
详情
bitcoin/bitcoin avatar
bitcoinbitcoin
11 小时前
90.6k
30.0k
345

Bitcoin Core 集成/暂存树

bitcoinc-plus-pluscryptocurrency+2
C++
324.5 MB
0
详情

关于

c-plus-plusclicmakeconsolecplusplus-20cppcross-platformcross-platform-desktopcross-platform-guidesktopframeworkguigui-frameworkgui-toolkitportableraiitest-frameworktoolkitunittestxtd
  • MIT License
  • 1.2k Stars
  • 79 Forks
  • 35 Watching

简要分析

热度分
1366
价值分
726
活跃状态
活跃
GitHub

语言占比

Batchfile
C
C#
C++
CMake
CSS
Objective-C++
Shell

Release

  • v0.1.2-beta2024年3月12日
  • v0.1.1-beta2023年7月18日
  • v0.1.0-beta2021年10月10日

贡献者

gammasoft71gammasoft71baderouaichbaderouaichgithub-actions[bot]github-actions[bot]jimorcjimorcemmanuel-ferdmanemmanuel-ferdmanGermanAizekGermanAizekyfiumefreddoyfiumefreddobigplaysznbigplaysznqingyiwebtqingyiwebtdeltoro05deltoro05niansaniansapikammmmmpikammmmm

xtd

Write Once, Run Everywhere!

logo


xtd (pronounced “extend”) is a modern C++20/23 framework to create console (CLI), forms (GUI) and unit test (xUnit) multiplatform applications and libraries.




codecov web Reference Guide wiki discord Download xtd OctoCounts

Latest news

  • xtd 1.0.0 will require C++20 as the minimum standard - Posted on June 15, 2025
  • Release xtd 0.1.2 (beta) - Posted on March 12, 2024
  • The xtd 1.0.0 is growing - Posted on November 12, 2023
  • Release xtd 0.1.1 (beta) - Posted on July 17, 2023
  • All news

Features

  • Free and open-source (MIT License);
  • a collection of native C++ classes libraries, to extend std;
  • API close to the .net API with a modern C++ approach and full integration with the std standard;
  • xtd is designed to manage GUI controls and dialogs in pure native mode or with CSS styles.
  • written in efficient, modern C++20/23 with RAII programming idiom;
  • and highly portable and available on many different platforms;
  • See features for more information.

xtd libraries architecture

architecture_logo

xtd consists of several libraries.

xtd.core

core The xtd.core library is modern C++20/23 libraries of classes, interfaces, and value types that provide access to system functionality. It is the foundation on which c++ applications, components, and controls are built.

xtd.drawing

drawing The xtd.drawing library contains types that support basic GDI+ graphics functionality. Child namespaces support advanced two-dimensional and vector graphics functionality, advanced imaging functionality, and print-related and typographical services. A child namespace also contains types that extend design-time user-interface logic and drawing.

xtd.forms

forms The xtd.forms library contains classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and linux-based operating system.

xtd.tunit

tunit The xtd.tunit library is a unit-testing framework for modern C++20, inspired by Microsoft.VisualStudio.TestTools.Cpp.

Getting Started

  • Installation provides download, install and uninstall documentation.
  • Guides provides xtd guides and tutorials.
  • Examples provides 1k examples to help you use xtd, grouped by libraries and topics.

Development status

  • Release notes provides release notes information.
  • Roadmap provides a view of the xtd roadmap.
  • Kanban board provides a Kanban view for all tasks (enhancements, pull requests, bugs, questions,…).
  • Development status provides information about classes and libraries development status.
  • Translation status provides information about translations status.

Current release status

GitHub milestone GitHub milestone

This project is an open source project. The developers who participate do so on their own time. It is therefore difficult to set release dates.

But you can follow the evolution of the development. We keep the status up to date.

Continuous Integration build status

At each commit, a build and unit tests are performed for the following configurations

Operating system Architecture Compiler Build Type Status
Linux (Ubuntu) x86 / x64 Clang / GCC Debug / Release Ubuntu
macOS x64 / arm64 Apple Clang Debug / Release macOS
Windows x86 / x64 MSVC (VS2022) Debug / Release Windows
Windows (MSYS2) x64 Clang / GCC Debug / Release Manually
Android (*) arm64-v8a / armeabi-v7a Clang (NDK) Release Coming soon
iOS (*) arm64 / x86_64 sim Apple Clang Release Coming soon
FreeBSD x64 Clang / GCC Debug / Release Manually
Haiku (*) x86 GCC Debug Manually

(*) xtd.core and xtd.tunit only.

Deploy to GitHub Pages status
Deployment of the website Ubuntu Debug
Deployment of the latest reference guide Ubuntu Debug

Issues status

As xtd is managed by a Kanban project, the number of open issues can be quite large. The table below gives a clearer view on the number of open bugs/questions and enhancements.

Issues Open Closed
Bugs / Questions from users GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.1.0 - Enhancements / Developments (**) GitHub issue custom search in repo GitHub issue custom search in repo
xtd 0.1.1 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 1.0.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 1.1.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 1.2.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 1.3.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo
xtd 2.0.0 - Enhancements / Developments GitHub issue custom search in repo GitHub issue custom search in repo

(**) There is only one enhancement for xtd 0.1.0, as project management was not yet available.

Examples

The classic first application ‘Hello World’.

Console (CLI)

This example demonstrates how to display a simple message in the console using xtd.core.

hello_world_console.cpp
#include <xtd/xtd>

class example {
public:
  static auto main() {
    console::background_color(console_color::blue);
    console::foreground_color(console_color::white);
    console::write_line("Hello, World!");
  }
};

startup_(example::main);

or simply

#include <xtd/xtd>

auto main() -> int {
  console::out << background_color(console_color::blue) << foreground_color(console_color::white) << "Hello, World!" << environment::new_line;
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.20)

project(hello_world_console)
find_package(xtd REQUIRED)
add_sources(hello_world_console.cpp)
target_type(CONSOLE_APPLICATION)
Build and run

Open “Command Prompt” or “Terminal”. Navigate to the folder that contains the project and type the following:

xtdc run
Output

Screenshot

Coroutines C++20 with xtd::threading::tasks

This example asynchronously prints a greeting for each world in parallel, then waits for all greetings to be printed using xtd.core.

hello_world_coroutine.cpp
#include <xtd/xtd>

class program {
public:
  static auto main() async_ {
    auto worlds = {u8"World"_s, u8"Mundo"_s, u8"Monde"_s, u8"Mondo"_s, u8"モンド"_s, u8"世界"_s, u8"Welt"_s, u8"Мир"_s};
    co_await parallel::for_each_async(worlds, [](auto world) async_ {
      co_await task<>::delay(100_ms);
      println("Hello, {}!", world);
    });
  }
};

startup_(program::main);

or simply

#include <xtd/xtd>

auto main_async() -> task<> {
  auto worlds = {u8"World"_s, u8"Mundo"_s, u8"Monde"_s, u8"Mondo"_s, u8"モンド"_s, u8"世界"_s, u8"Welt"_s, u8"Мир"_s};
  co_await parallel::for_each_async(worlds, [](auto world) -> task<> {
    co_await task<>::delay(100_ms);
    println("Hello, {}!", world);
  });
}

auto main() -> int {
  return startup::run(main_async);
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.20)

project(hello_world_coroutine)
find_package(xtd REQUIRED)
add_sources(hello_world_coroutine.cpp)
target_type(CONSOLE_APPLICATION)
Build and run

Open “Command Prompt” or “Terminal”. Navigate to the folder that contains the project and type the following:

xtdc run
Output
Hello, 世界!
Hello, Мир!
Hello, World!
Hello, Welt!
Hello, Mondo!
Hello, Monde!
Hello, モンド!
Hello, Mundo!

Forms (GUI like WinForms)

This example demonstrates how to create a simple graphical application using xtd.forms.

hello_world_forms.cpp
#include <xtd/xtd>

class main_form : public form {
public:
  static auto main() {
    application::run(main_form {});
  }
  
  main_form() {
    text("Hello world (message_box)");

    button1.location({10, 10});
    button1.parent(self_);
    button1.text("&Click me");
    button1.click += delegate_ {
      message_box::show("Hello, World!");
    };
  }
  
private:
  button button1;
};

startup_(main_form::main);

or simply

#include <xtd/xtd>

auto main() -> int {
  auto main_form = form::create("Hello world (message_box)");
  auto button1 = button::create(main_form, "&Click me", {10, 10});
  button1.click += [] {message_box::show("Hello, World!");};
  application::run(main_form);
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.20)

project(hello_world_forms)
find_package(xtd REQUIRED)
add_sources(hello_world_forms.cpp)
target_type(GUI_APPLICATION)
Build and run

Open “Command Prompt” or “Terminal”. Navigate to the folder that contains the project and type the following:

xtdc run
Output
Windows

Screenshot

Screenshot

macOS

Screenshot

Screenshot

Linux Gnome

Screenshot

Screenshot

tunit (Unit tests like Microsoft Unit Testing Framework)

This example demonstrates how to write and run unit tests using xtd.tunit.

hello_world_test.cpp
#include <xtd/xtd>

namespace unit_tests {
  class test_class_(hello_world_test) {
    auto test_method_(create_string_from_literal) {
      auto s = string {"Hello, World!"};
      valid_that(s.length()).is().equal_to(13_z);
      assert_that(s).is().equal_to("Hello, World!");
    }
    
    auto test_method_(create_string_from_chars) {
      auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
      valid_that(s.length()).is().equal_to(13_z);
      assert_that(s).does().start_with("Hello,").and_().does().end_with(" World!");
    }
    
    static auto main() {
      console_unit_test {}.run();
    }
  };
}

startup_(unit_tests::hello_world_test::main);

or without constraints

#include <xtd/xtd>

namespace unit_tests {
  class test_class_(hello_world_test) {
    auto test_method_(create_string_from_literal) {
      auto s = string {"Hello, World!"};
      valid::are_equal(13_z, s.length());
      assert::are_equal("Hello, World!", s);
    }
    
    auto test_method_(create_string_from_chars) {
      auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
      valid::are_equal(13_z, s.length());
      string_assert::starts_with("Hello,", s);
      string_assert::does_end_with(" World!", s);
    }
    
    static auto main() {
      console_unit_test {}.run();
    }
  };
}

startup_(unit_tests::hello_world_test::main);
CMakeLists.txt
cmake_minimum_required(VERSION 3.20)

project(hello_world_test)
find_package(xtd REQUIRED)
add_sources(hello_world_test.cpp)
target_type(TEST_APPLICATION)
Build and run

Open “Command Prompt” or “Terminal”. Navigate to the folder that contains the project and type the following:

xtdc run
Output

Screenshot

Visual Studio Output

Screenshot

Gallery

Minesweeper

minesweeper

minesweeper (on Windows)


Game of Life

game_of_life

game_of_life (on macOS)


xtdc-gui

xtdc-gui

xtdc-gui - Create a new project (on macOS)


Calculator

calculator

calculator (on Ubuntu)


Stopwatch

stopwatch

stopwatch (on Windows)


Painting

painting

painting (on Ubuntu)

Contributing

The authors file lists contributors together with contact information. If you make a contribution, please add yourself to the list.

Your contributions are welcome.

  • First read Code of conduct and the design guidelines to make sure your contribution follows the rules.
  • Fork the project and use a pull request for adding your contribution.
  • If you encounter any problems, feel free to open an issue in the issues tracker. If you feel like there is a missing feature, please raise a ticket on Github. Pull requests are also welcome.

Your feedback is important for the evolution of the project.

Beginners

The following project aims to simplify and guide the way beginners make their first contribution. If you are looking to make your first contribution, check out the project below.

First Contributions

Now you are ready to make your first contribution to xtd.

See also

  • website
  • wiki
  • github
  • project
  • Reference Guide
  • Support

© 2026 Gammasoft.

评论

登录 后发表评论
暂无评论
GitRead 中文社区
深度解读 · 趋势洞察 · 价值精选

关于

关于我们联系我们编辑准则收录标准赞赏人员

发现

技术趋势新手训练营资源精选实战指南精选专题热门话题GitHub 文档

条款

隐私政策服务条款网站地图
26.9万收录项目
5.3万中文话题
155精选专题
发现技术价值,连接开源智慧
© 2026 GitRead · GitHub 中文社区 本站与 GitHub, Inc. 无隶属关系;GitHub 是 GitHub, Inc. 的商标。