public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Han Jiang <oglops@gmail.com>
To: crossgcc@sourceware.org
Subject: Fwd: Error when compiling rpcapd in winpcap
Date: Mon, 14 Dec 2015 06:06:00 -0000	[thread overview]
Message-ID: <CAPiRsUWuP8QxECvw_kvQnox7ov-yaisX5F9HCMhcweriaaZDtw@mail.gmail.com> (raw)
In-Reply-To: <CAPiRsUXh2eoYV1-rTLd2WfZ96vhOae955qWD=bFyXP-pjdDDog@mail.gmail.com>

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

           reply	other threads:[~2015-12-14  6:06 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAPiRsUXh2eoYV1-rTLd2WfZ96vhOae955qWD=bFyXP-pjdDDog@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPiRsUWuP8QxECvw_kvQnox7ov-yaisX5F9HCMhcweriaaZDtw@mail.gmail.com \
    --to=oglops@gmail.com \
    --cc=crossgcc@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).