This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See crosstool-NG for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: Error when compiling rpcapd in winpcap


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]