Hi!

On Don, 2013-05-02 at 14:47 +0200, Lambrecht Jürgen wrote:
[...]
> I am struggling to get the busybox dhcp server cross-compiled (ARM) for 
> the embedded RTOS eCos.
> I took the latest code from git.
> I have this error:
> dhcpd.c:328:10: error: ‘optind’ undeclared (first use in this function)
> 
> I found out that 'optind' is declared in /usr/include/getopt.h.
> This is given by the toolchain.

Hmm, /usr/include/getopt.h is from the C library of the host system/the
local installation.
The cross-toolchain/build-system should have it's own set of header
files, libraries, etc. and must not use the one from the host system.

> 'int optind' is defined in your toolchain libraries.

And where are the header files for these?
There is no guarantee that the types, there sizes and padding is the
same for the host and the target system.
OK, "optind" maybe defined everywhere identically but in the general
case?

> This is OK for a linux (cross-)compilation, but not for an eCos one.

Even there it should be totally separated.

> Is it correct that busybox only works (and compiles) for a system with a 
> shell?

What has the getopt() library function - which is the only one which
uses "optind" - to do with a shell?

        Bernd
-- 
Bernd Petrovitsch                  Email : [email protected]
                     LUGA : http://www.luga.at

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to