diff --git a/docs/manual/en_US/first.md b/docs/manual/en_US/first.md new file mode 100644 index 0000000..012e57e --- /dev/null +++ b/docs/manual/en_US/first.md @@ -0,0 +1,31 @@ +# First project + +Let's create the first bfdev based project: + +```c +#include + +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 +``` diff --git a/docs/manual/index.md b/docs/manual/index.md index 6fb8ad3..7a7e753 100644 --- a/docs/manual/index.md +++ b/docs/manual/index.md @@ -7,6 +7,7 @@ ## Development guide +- [First project](en_US/first.md) - [Code layout](en_US/layout.md) - [Include files](en_US/include.md)