-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: John Sanpe <[email protected]>
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters