mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 08:06:32 +00:00
添加初始化DragonOS的Rust-Musl工具链的脚本. (#426)
This commit is contained in:
15
docs/userland/appdev/c-cpp-quick-start.md
Normal file
15
docs/userland/appdev/c-cpp-quick-start.md
Normal file
@ -0,0 +1,15 @@
|
||||
# 为DragonOS开发C/C++应用
|
||||
|
||||
## 编译环境
|
||||
|
||||
  DragonOS与Linux具有部分二进制兼容性,因此可以使用Linux的musl-gcc进行编译。但是由于DragonOS还不支持动态链接,
|
||||
因此要增加编译参数`-static`
|
||||
|
||||
比如,您可以使用
|
||||
```shell
|
||||
musl-gcc -static -o hello hello.c
|
||||
```
|
||||
来编译一个hello.c文件。
|
||||
|
||||
在移植现有程序时,可能需要配置`CFLAGS`和`LDFLAGS`,以及`CPPFLAGS`,以便正确地编译,具体请以实际为准。
|
||||
|
Reference in New Issue
Block a user