I have a program which use libevent library
when compile the program, the compiling command is like:
gcc -o myprogram mysource.c mysource.h -levent
so it is dynamic linking.
now I want to run this program on a computer where there is no libevent, I need static linking so that my program can be run on that computer, are there any easy steps?
I tried -static
, but I got the following error:
[root@kitty relay]# gcc -o relay -static mysource.c mysource.h -levent -lpcap
/usr/bin/ld: cannot find -lpcap
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
why?