Skip to content

Commit

Permalink
Add static linking info
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch authored Nov 4, 2024
1 parent f52adb7 commit e980bca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/C_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,14 @@ If [libprimesieve is installed](https://github.com/kimwalisch/primesieve#install
on your system, then you can compile any of the C example programs above using:

```sh
# Link against shared libprimesieve
cc -O3 primes.c -o primes -lprimesieve

# For statically linking libprimesieve into your C program you need to link
# against libprimesieve, the C++ standard library and the math library.
# Please note that the linking command may be different for your particular
# compiler and operating system.
gcc -O3 -static primes.c -o primes -lprimesieve -lstdc++ -lm
```

If you have [built libprimesieve yourself](BUILD.md#primesieve-build-instructions),
Expand Down

0 comments on commit e980bca

Please sign in to comment.