0

次のパラメーターを使用Cして、アプリケーションをコンパイルして実行できます。CentOS

gcc test.c -o test -lpcap -lssl -lcrypto -L /usr/local/lib -L /usr/local/opt/openssl/lib/ -lhiredis

しかし、コンパイルもダウンロードもできないマシンでアプリケーションを実行する必要があります。hiredis.

したがって、すべてを自分でコンパイルする必要がありますCentOS-これはセットアップで一致します。

フラグについて読みましたstaticが、そうすると次のエラーが発生します。

gcc -static test.c -o test -lpcap -lssl -lcrypto -L /usr/local/lib -L /usr/local/opt/openssl/lib/ -lhiredis

/usr/bin/ld: cannot find -lpcap
/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
/usr/local/lib/libhiredis.a(net.o): In function `_redisContextConnectTcp':
/home/alfredballe/hiredis/net.c:399: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned 1 exit status

私は何を間違っていますか?

4

0 に答える 0