Libc
Standard C/C++ library template
Install / Use
/learn @caprese-project/LibcREADME
Standard C/C++ Library Template
This library implements only the OS-independent parts of the C and C++ standard libraries. By adding OS-dependent functions, it can be made to run on any system. This allows for the use of functions and classes that are only supported in the host environment, even on custom OSes that do not conform to common APIs such as POSIX or WASI.
How to Use
Installing Locally
To use the library, you can install it locally on your system. Here's how you can do that:
Prerequisites
Before installing, make sure you have installed all of the following:
- CMake version 3.20 or higher
- Ninja
Download the Source Code
You can download the source code from GitHub at https://github.com/caprese-project/libc
git clone https://github.com/caprese-project/libc
Build and Install
Once you have the source code, you can build and install the library with the following commands:
cmake -B build -G Ninja -DCMAKE_C_COMPILER:FILEPATH=/path/to/your/c-compiler
cmake --build build
sudo cmake --install build
This will install the library to the default system location (e.g. /usr/local/). If you want to install it to a different location, you can use the --prefix option:
sudo cmake --install build --prefix /path/to/install/prefix
Using with FetchContent
Alternatively, you can use CMake's FetchContent module to incorporate the library into your project without a local installation. Here's an example of how to do that:
- Add the following to your project's
CMakeLists.txtfile:
include(FetchContent)
FetchContent_Declare(
caprese_libc
GIT_REPOSITORY https://github.com/caprese-project/libc
GIT_TAG master # or any other tag or commit hash
)
FetchContent_MakeAvailable(caprese_libc)
- Then, you can link against the library as you normally would with
target_link_libraries:
target_link_libraries(your_target PRIVATE caprese_libc)
Note
- This library is provided as a template, and developers can customize it as needed.
- Implementations such as string.h are OS-independent and are provided as a template, but OS-dependent parts need to be implemented by the developer.
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
