* Fwd: Error when compiling rpcapd in winpcap
[not found] ` <CAPiRsUXh2eoYV1-rTLd2WfZ96vhOae955qWD=bFyXP-pjdDDog@mail.gmail.com>
@ 2015-12-14 6:06 ` Han Jiang
0 siblings, 0 replies; only message in thread
From: Han Jiang @ 2015-12-14 6:06 UTC (permalink / raw)
To: crossgcc
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-12-14 6:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAPiRsUVw_ZBTZ897azcD42QzByPRyrSLm7TsZ3Pf0=hAfCjvDQ@mail.gmail.com>
[not found] ` <CAPiRsUXh2eoYV1-rTLd2WfZ96vhOae955qWD=bFyXP-pjdDDog@mail.gmail.com>
2015-12-14 6:06 ` Fwd: Error when compiling rpcapd in winpcap Han Jiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).