An open API service indexing awesome lists of open source software.

https://github.com/jarun/libonexe

Demo a pair of inter-dependent library and executable
https://github.com/jarun/libonexe

Last synced: 4 months ago
JSON representation

Demo a pair of inter-dependent library and executable

Awesome Lists containing this project

README

          

# libonexe

Simple project to demo a library (libsum.a) and an executable may be inter-dependent.

Outline:

`prog.c` defines `mean(int, int)` and calls the function `sum(int, int)` which is defined in the library.

`calc_sum.c` defines `sum(int, int)` which calls `mean(int, int)`.

Run the following commands:

```
/* Generate the static library libsum.a */
gcc -c calc_sum.c -o calc_sum.o
ar rcs libsum.a calc_sum.o

/* Compile the main program statically */
gcc -static prog.c -L. -lsum -o prog
```

Command ref: http://www.adp-gmbh.ch/cpp/gcc/create_lib.html