What problem does it solve?
This Skill provides comprehensive guidance on configuring, building, and running C interoperability projects for the Cangjie language, including handling dynamic and static libraries across different platforms.
Core Features & Use Cases
- Platform-Specific Library Naming: Details naming conventions for shared and static libraries on Linux, macOS, and Windows.
- Compiler Linker Options: Explains essential
cjc compiler flags like -L and -l for library path and linking.
- Direct Compilation Examples: Provides step-by-step shell commands for compiling C code into libraries and linking them with Cangjie code on various operating systems.
cjpm Project Integration: Guides users on configuring cjpm.toml for FFI dependencies and building/running projects.
- Security Best Practices: Recommends compiler and linker flags for enhanced security (e.g.,
-fstack-protector-all, -z noexecstack).
Quick Start
Use the cangjie-ffi-build skill to learn how to compile a C shared library named 'native' and link it with a Cangjie main file named 'main.cj' on Linux.