Skip to content

Commit 8be8d46

Browse files
committed
feat first: added initial document
Signed-off-by: John Sanpe <[email protected]>
1 parent 5ff7d02 commit 8be8d46

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

docs/manual/en_US/first.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# First project
2+
3+
Let's create the first bfdev based project:
4+
5+
```c
6+
#include <bfdev.h>
7+
8+
int main(int argc, const char *argv[])
9+
{
10+
bfdev_log_info("helloworld\n");
11+
return 0;
12+
}
13+
```
14+
15+
If bfdev is installed on user's local, we first need to set the environment variables, you can also add it to bashrc:
16+
17+
```shell
18+
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/.local/include
19+
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$HOME/.local/include
20+
export LIBRARY_PATH=$LIBRARY_PATH:$HOME/.local/lib:$HOME/.local/lib64
21+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib:$HOME/.local/lib64
22+
```
23+
24+
Then we compile and run it:
25+
26+
```
27+
# gcc -lbfdev -o helloworld helloworld.c
28+
# ./helloworld
29+
[info] helloworld
30+
```

docs/manual/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
## Development guide
99

10+
- [First project](en_US/first.md)
1011
- [Code layout](en_US/layout.md)
1112
- [Include files](en_US/include.md)
1213

0 commit comments

Comments
 (0)