Skip to content

Commit 17f63ae

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

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

docs/manual/en_US/first.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
16+
If bfdev is installed on user's local, we first need to set the environment variables, you can also add it to bashrc:
17+
18+
```shell
19+
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/.local/include
20+
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$HOME/.local/include
21+
export LIBRARY_PATH=$LIBRARY_PATH:$HOME/.local/lib:$HOME/.local/lib64
22+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib:$HOME/.local/lib64
23+
```
24+
25+
Then we compile and run it:
26+
27+
```
28+
# gcc -lbfdev -o helloworld helloworld.c
29+
# ./helloworld
30+
[info] helloworld
31+
```

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)