Skip to content

Commit c5f9cb6

Browse files
committed
docs: add modular library usage example to README
1 parent c03c3f8 commit c5f9cb6

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,23 @@ kind = "bin"
104104
main = "src/main.cpp"
105105
```
106106

107+
### 使用模块化库
108+
109+
`mcpp.toml` 中添加两行依赖,即可引用 [mcpplibs](https://github.com/mcpplibs) 社区模块化库:
110+
111+
```toml
112+
[dependencies]
113+
cmdline = "0.0.2"
114+
```
115+
116+
然后在代码中直接 `import`
117+
118+
```cpp
119+
import mcpplibs.cmdline;
120+
```
121+
122+
> 更多依赖配置方式(版本约束、命名空间、Git 引用、本地路径等)参见 [mcpp.toml 指南 — 依赖管理](docs/05-mcpp-toml.md)
123+
107124
## 功能概览
108125

109126
<details>

0 commit comments

Comments
 (0)