首页 > MAC OSX 10.9 安装 Tcpreplay 卡住了

MAC OSX 10.9 安装 Tcpreplay 卡住了

我在./configure ;sudo make install的时候总提示如下错误:

configure: WARNING: Apple OS X versions prior to 10.5 (Leopard) has a serious problem!
Please see: http://tcpreplay.synfin.net/trac/ticket/142 for more details
Making install in scripts
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
Making install in lib
gcc -DHAVE_CONFIG_H -I. -I../src     -D_U_="__attribute__((unused))"  -Wall -O3 -std=gnu99    -I/usr/local/include -MT strlcat.o -MD -MP -MF .deps/strlcat.Tpo -c -o strlcat.o strlcat.c
strlcat.c:34:1: error: expected parameter declarator
strlcat(char *dst, const char *src, size_t siz)
^
/usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
                                           ^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                             ^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
#    define _USE_FORTIFY_LEVEL 2
                               ^
strlcat.c:34:1: error: expected ')'
/usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
                                           ^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                             ^
/usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
#    define _USE_FORTIFY_LEVEL 2
                               ^
strlcat.c:34:1: note: to match this '('
/usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
                                           ^
/usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                    ^
strlcat.c:34:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
strlcat(char *dst, const char *src, size_t siz)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
                                           ^~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                              ^~~~~~~~~~~~~~~~~~~~~
strlcat.c:34:1: error: conflicting types for '__builtin___strlcat_chk'
/usr/include/secure/_string.h:111:3: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
  ^
strlcat.c:34:1: note: '__builtin___strlcat_chk' is a builtin with type 'unsigned long (char *, const
      char *, unsigned long, unsigned long)'
/usr/include/secure/_string.h:111:3: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
  ^
strlcat.c:34:1: error: definition of builtin function '__builtin___strlcat_chk'
strlcat(char *dst, const char *src, size_t siz)
^
/usr/include/secure/_string.h:111:3: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
  ^
1 warning and 4 errors generated.
make[1]: *** [strlcat.o] Error 1
make: *** [install-recursive] Error 1

你安装了 libpcap 的库文件,但是没有头文件,或者,配置脚本没找到它们。

首先确定你有 pcap.h 等文件,它在哪里。检查 config.log 文件来看配置脚本是怎么、在哪里寻找的。


#include <stdio.h>

/*
  This program can solve your problem, you can compile and run it.
*/
main()
{
    int age; // the age of your mac
    scanf("%d", &age); // please enter the age of your mac

    if (age >= 2)
        printf("You should install the os x 10.7.5, because it allows you to better enjoy.");
    else
        printf("Ask baidu.com");
}

解决了。OSX 10.9的BUG,用 MACPORT 安装搞定

【热门文章】
【热门文章】