mirror of
https://github.com/theoludwig/libcproject.git
synced 2024-11-12 15:23:12 +01:00
docs: improve usage explanations
This commit is contained in:
parent
dff2836bfc
commit
d604288365
35
README.md
35
README.md
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
C is a low-level programming language and we often end up reinventing the wheel as the C standard library (`libc`) is quite small and in my humble opinion, not well designed.
|
C is a low-level programming language and we often end up reinventing the wheel as the C standard library (`libc`) is quite small and in my humble opinion, not well designed.
|
||||||
|
|
||||||
**libcproject** solve this by providing common functions or data structures (`hash_map`, `array_list`, `linked_list`, `queue`, `stack`, etc.) we might need in our C projects.
|
**libcproject** solve this by providing common functions or data structures (`hash_map`, `array_list`, `linked_list`, `queue`, `stack`, etc.), we might need in our C projects.
|
||||||
|
|
||||||
[Online documentation](https://libcproject.vercel.app/).
|
[Online documentation](https://libcproject.vercel.app/).
|
||||||
|
|
||||||
@ -36,7 +36,10 @@ C is a low-level programming language and we often end up reinventing the wheel
|
|||||||
For example on GNU/Linux Ubuntu:
|
For example on GNU/Linux Ubuntu:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
# Install Build Tools
|
||||||
sudo apt-get install build-essential gcc make clang-format
|
sudo apt-get install build-essential gcc make clang-format
|
||||||
|
|
||||||
|
# Install Documentation Tools
|
||||||
sudo apt-get install doxygen doxygen-gui doxygen-doc graphviz
|
sudo apt-get install doxygen doxygen-gui doxygen-doc graphviz
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -55,7 +58,14 @@ nm ./build/libcproject.a # to see the symbols
|
|||||||
|
|
||||||
Steps to create a new C project that uses `libcproject`:
|
Steps to create a new C project that uses `libcproject`:
|
||||||
|
|
||||||
### Step 1: Install and Compile `libcproject`
|
### Step 1: Create a new project
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mkdir my-project
|
||||||
|
cd my-project
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 2: Install and Compile `libcproject` in the project
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Clone the repository
|
# Clone the repository
|
||||||
@ -68,25 +78,10 @@ cd libcproject
|
|||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 2: Create a new project
|
### Step 3: Create a new C file
|
||||||
|
|
||||||
```sh
|
|
||||||
mkdir my-project
|
|
||||||
cd my-project
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 3: Install `libcproject` in the project
|
|
||||||
|
|
||||||
```sh
|
|
||||||
mkdir libcproject
|
|
||||||
cp --recursive <path-to-libcproject> ./ # copy
|
|
||||||
# or
|
|
||||||
ln -s <path-to-libcproject> ./ # symbolic link
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 4: Create a new C file
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
cd ..
|
||||||
touch main.c
|
touch main.c
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -104,7 +99,7 @@ int main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 5: Compile your project and link it with the library
|
### Step 4: Compile your project and link it with the library
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
gcc -o ./main ./main.c -L. -l:./libcproject/build/libcproject.a
|
gcc -o ./main ./main.c -L. -l:./libcproject/build/libcproject.a
|
||||||
|
Loading…
Reference in New Issue
Block a user