次のパラメーターを使用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
私は何を間違っていますか?