Skip to content

Commit

Permalink
feat first: added initial document
Browse files Browse the repository at this point in the history
Signed-off-by: John Sanpe <[email protected]>
  • Loading branch information
sanpeqf committed Mar 12, 2024
1 parent 5ff7d02 commit 17f63ae
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/manual/en_US/first.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# First project

Let's create the first bfdev based project:

```c
#include <bfdev.h>

int main(int argc, const char *argv[])
{
bfdev_log_info("helloworld\n");
return 0;
}

```
If bfdev is installed on user's local, we first need to set the environment variables, you can also add it to bashrc:
```shell
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/.local/include
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$HOME/.local/include
export LIBRARY_PATH=$LIBRARY_PATH:$HOME/.local/lib:$HOME/.local/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/lib:$HOME/.local/lib64
```

Then we compile and run it:

```
# gcc -lbfdev -o helloworld helloworld.c
# ./helloworld
[info] helloworld
```
1 change: 1 addition & 0 deletions docs/manual/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

## Development guide

- [First project](en_US/first.md)
- [Code layout](en_US/layout.md)
- [Include files](en_US/include.md)

Expand Down

0 comments on commit 17f63ae

Please sign in to comment.