コードをダウンロードしました ("bzr branch lp:tcprstat" でコードを取得 - 合計 1.5 MB) が、コンパイルできません。tcprstat ディレクトリに表示されるファイルは次のとおりです。私は従来の ./configure、make、sudo make install に精通しており、かなり IT に精通しています。
問題の解決(Mehmet の入力に従います)。
このページhttp://xcb.freedesktop.org/dist/から、次のファイルを取得しました。
libpthread-stubs-0.3.tar.gz (2009 年 10 月 14 日 02:16 267K)
Ran ./configure, make, sudo make install.
プログラムはまだ同じエラーでコンパイルに失敗しましたが、さらにグーグル (「centos pthread がありません」) でこのページ https://www.centos.org/forums/viewtopic.php?t=3517が表示 され、賢明なアドバイスが含まれていました 。
yum install glibc-static
(私はsudoでやった)
ほら。
50 ボーナス ポイントを集めてくれた Mehmet に感謝 (そしておめでとう :-) )。
ps Mehmet、Linux での静的/動的リンクに関する適切なガイドはありますか?
【問題の完全な説明】
私はこれについて怠惰ではありませんでした (私たちが話しているように本をダウンロードしています)、automake、autoconf、make、aclocal、bootstrap の多くのバリエーションを試しましたが、困惑しています。はい、私は README を読みましたが、作成者は誰もが GNU ツールチェーンを知っていると考えているようです。これまでで最も成功した取り組みの詳細を、投稿の最後に記載しました。
Summary of best efforts (details at bottom)
chmod 755 ./bootstrap
./bootstrap <--- at this point more files appear in the directory
./configure // appeared to work fine
make // errors -> /usr/bin/ld: cannot find -lpthread -lp,
誰かがこのプログラムをコンパイルする方法を教えてくれたら、とてもありがたいです。
========= ファイルの初期リスト =============
-rw-rw-r--. 1 pol pol 38 Jan 30 09:46 AUTHORS
-rw-rw-r--. 1 pol pol 926 Jan 30 09:46 bootstrap
-rw-rw-r--. 1 pol pol 0 Jan 30 09:46 ChangeLog
-rw-rw-r--. 1 pol pol 2643 Jan 30 09:46 configure.ac
-rw-rw-r--. 1 pol pol 35147 Jan 30 09:46 COPYING
drwxrwxr-x. 2 pol pol 4096 Jan 30 09:46 libpcap
-rw-rw-r--. 1 pol pol 922 Jan 30 09:46 Makefile.am
-rw-rw-r--. 1 pol pol 914 Jan 30 09:46 NEWS
-rw-rw-r--. 1 pol pol 2730 Jan 30 09:46 README
drwxrwxr-x. 2 pol pol 4096 Jan 30 09:46 src
-rw-rw-r--. 1 pol pol 81 Jan 30 09:46 TODO
============= ベスト エフォート ===============
./ブートストラップを実行
[pol@localhost tcprstat]$ chmod 755 bootstrap
[pol@localhost tcprstat]$ ./bootstrap
configure.ac:80: warning: AC_CONFIG_SUBDIRS: you should use literals
../../lib/autoconf/status.m4:1097: AC_CONFIG_SUBDIRS is expanded from...
configure.ac:80: the top level
configure.ac:80: warning: AC_CONFIG_SUBDIRS: you should use literals
../../lib/autoconf/status.m4:1097: AC_CONFIG_SUBDIRS is expanded from...
configure.ac:80: the top level
configure.ac:80: warning: AC_CONFIG_SUBDIRS: you should use literals
../../lib/autoconf/status.m4:1097: AC_CONFIG_SUBDIRS is expanded from...
configure.ac:80: the top level
configure.ac:31: installing './compile'
configure.ac:26: installing './install-sh'
configure.ac:26: installing './missing'
Makefile.am: installing './INSTALL'
src/Makefile.am: installing './depcomp'
configure.ac:80: warning: AC_CONFIG_SUBDIRS: you should use literals
../../lib/autoconf/status.m4:1097: AC_CONFIG_SUBDIRS is expanded from...
configure.ac:80: the top level
[pol@localhost tcprstat]$ ll
total 336
==== ./bootstrap 実行後の新しいファイルリスト
-rw-rw-r--. 1 pol pol 39001 Jan 30 10:27 aclocal.m4
-rw-rw-r--. 1 pol pol 38 Jan 30 10:27 AUTHORS
drwxr-xr-x. 2 pol pol 4096 Jan 30 10:27 autom4te.cache
-rwxr-xr-x. 1 pol pol 926 Jan 30 10:27 bootstrap
-rw-rw-r--. 1 pol pol 0 Jan 30 10:27 ChangeLog
lrwxrwxrwx. 1 pol pol 32 Jan 30 10:27 compile -> /usr/share/automake-1.13/compile
-rw-rw-r--. 1 pol pol 3039 Jan 30 10:27 config.h.in
-rwxrwxr-x. 1 pol pol 192216 Jan 30 10:27 configure
-rw-rw-r--. 1 pol pol 2643 Jan 30 10:27 configure.ac
-rw-rw-r--. 1 pol pol 35147 Jan 30 10:27 COPYING
lrwxrwxrwx. 1 pol pol 32 Jan 30 10:27 depcomp -> /usr/share/automake-1.13/depcomp
lrwxrwxrwx. 1 pol pol 32 Jan 30 10:27 INSTALL -> /usr/share/automake-1.13/INSTALL
lrwxrwxrwx. 1 pol pol 35 Jan 30 10:27 install-sh -> /usr/share/automake-1.13/install-sh
drwxrwxr-x. 2 pol pol 4096 Jan 30 10:27 libpcap
-rw-rw-r--. 1 pol pol 922 Jan 30 10:27 Makefile.am
-rw-rw-r--. 1 pol pol 24785 Jan 30 10:27 Makefile.in
lrwxrwxrwx. 1 pol pol 32 Jan 30 10:27 missing -> /usr/share/automake-1.13/missing
-rw-rw-r--. 1 pol pol 914 Jan 30 10:27 NEWS
-rw-rw-r--. 1 pol pol 2730 Jan 30 10:27 README
drwxrwxr-x. 2 pol pol 4096 Jan 30 10:27 src
-rw-rw-r--. 1 pol pol 81 Jan 30 10:27 TODO
次に、./configure を実行します - 正常に動作しているように見えました - エラーはありません。
次に、make を実行しようとすると失敗します。エラーが表示されます。
mv -f .deps/tcprstat_static-stats-hash.Tpo .deps/tcprstat_static-stats-hash.Po
gcc -Wall -Werror -g -pthread -I../libpcap/libpcap-1.1.1/ -g -O2 -static -L../libpcap/libpcap-1.1.1/ -o tcprstat-static tcprstat_static-tcprstat.o tcprstat_static-functions.o tcprstat_static-capture.o tcprstat_static-process-packet.o tcprstat_static-local-addresses.o tcprstat_static-stats.o tcprstat_static-output.o tcprstat_static-stats-hash.o -lpthread -lpcap
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make[2]: *** [tcprstat-static] Error 1
make[2]: Leaving directory `/mysql/tools/tcprstat/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mysql/tools/tcprstat'
make: *** [all] Error 2
[pol@localhost tcprstat]$