From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113323 invoked by alias); 14 Dec 2015 06:06:00 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Received: (qmail 113304 invoked by uid 89); 14 Dec 2015 06:05:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f174.google.com Received: from mail-ob0-f174.google.com (HELO mail-ob0-f174.google.com) (209.85.214.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 14 Dec 2015 06:05:58 +0000 Received: by obciw8 with SMTP id iw8so124306997obc.1 for ; Sun, 13 Dec 2015 22:05:56 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.33.10 with SMTP id n10mr23802790oei.66.1450073156359; Sun, 13 Dec 2015 22:05:56 -0800 (PST) Received: by 10.60.142.65 with HTTP; Sun, 13 Dec 2015 22:05:56 -0800 (PST) In-Reply-To: References: Date: Mon, 14 Dec 2015 06:06:00 -0000 Message-ID: Subject: Fwd: Error when compiling rpcapd in winpcap From: Han Jiang To: crossgcc@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00006.txt.bz2 Hi I was trying to cross compile rpcapd and use on my asus rt-n16 router ( tomato shibby v132 firmware). I followed the tutorial on their official website. https://www.winpcap.org/docs/docs_40_2/html/group__remote.html#UNIX I successfully build my toolchain with crosstools-ng 1.22, ( it works I compiled some programs to run on my router, ) , but When I compile rpcapd , it errors out at this macro definition. it's in winpcap/wpcap/libpcap/pcap-int.h #ifndef HAVE_STRLCPY #define strlcpy(x, y, z) \ (strncpy((x), (y), (z)), \ ((z) <= 0 ? 0 : ((x)[(z) - 1] = '\0')), \ strlen((y))) #endif the same code compiles fine under linux ( centos 7.0) the error message is [oglop@t450s rpcapd]$ make mipsel-unknown-linux-uclibc-gcc -pthread -DHAVE_REMOTE -DHAVE_SNPRINTF -I../ -c daemon.c In file included from daemon.c:34:0: ../pcap-int.h:452:12: error: expected declaration specifiers or '...' before '(' token (wstrncpy((x), (y), (z)), ((z) <= 0 ? 0 : ((x)[(z) - 1] = '\0')), strlen((y))) ^ ../pcap-int.h:452:17: error: expected declaration specifiers or '...' before '(' token (wstrncpy((x), (y), (z)), ((z) <= 0 ? 0 : ((x)[(z) - 1] = '\0')), strlen((y))) ^ ../pcap-int.h:452:22: error: expected declaration specifiers or '...' before '(' token (wstrncpy((x), (y), (z)), ((z) <= 0 ? 0 : ((x)[(z) - 1] = '\0')), strlen((y))) ^ ../pcap-int.h:452:26: error: expected ')' before ',' token (wstrncpy((x), (y), (z)), ((z) <= 0 ? 0 : ((x)[(z) - 1] = '\0')), strlen((y))) ^ daemon.c: In function 'daemon_AuthUserPwd': daemon.c:684:39: warning: implicit declaration of function 'crypt' [-Wimplicit-function-declaration] if (strcmp(usersp->sp_pwdp, (char *) crypt(password, usersp->sp_pwdp) ) != 0) ^ make: *** [daemon.o] Error 1 my configure for libpcap is CC=mipsel-unknown-linux-uclibc-gcc CXX=mipsel-unknown-linux-uclibc-g++ AR=mipsel-unknown-linux-uclibc-ar RANLIB=mipsel-unknown-linux-uclibc-ranlib ac_cv_linux_vers=2 ./configure --prefix=$TARGET_DIR --host=mipsel-uclibc-linux --with-pcap=linux and it compiles fine. How can I get rid of the macro error ? Thanks! -- For unsubscribe information see http://sourceware.org/lists.html#faq