[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Include files?

The compile command is:
g++-cris -mlinux -xc++ -isystem /home/felson/axis/devboard_lx/eroot/include
-Wall -O2 -DELINUX -Wall -I../include -Wno-ctor-dtor-privacy -ansi -pipe
-c -o rs485_io.o rs485_io.cc

../include is an application specific include directory.

Results from compile:
rs485_io.cc: In method `rs485_io::rs485_io (char *, int)':
rs485_io.cc:65: `errno' undeclared (first use this function)
rs485_io.cc:65: (Each undeclared identifier is reported only once for
rs485_io.cc:65: each function it appears in.)
rs485_io.cc:70: implicit declaration of function `int cfmakeraw (...)'
rs485_io.cc: In method `void rs485_io::write (unsigned char *, int)':
rs485_io.cc:258: `int errno' used prior to declaration
rs485_io.cc:286: implicit declaration of function `int usleep (...)'
rs485_io.cc:257: warning: unused variable `char *errmsg'
make: *** [rs485_io.o] Error 1

This all started with R2.0.0;  there were no compile errors for R1.0.0

Adam Felson
HID Corporation - Engineering
11674 N. Huron Street
Denver, CO 80234-2924
(303) 453-3362

                    Hans-Peter Nilsson                                                                
                    <hans-peter.nilsson        To:     afelson@xxxxxxx.com                               
                                               Subject:     Re: Include files?                        
                    06/29/01 10:27 AM                                                                 

> From: Adam Felson <afelson@xxxxxxx.com>
> Date: Fri, 29 Jun 2001 09:20:23 -0600

> All I have left is to find where usleep() got moved to.  I'm
> getting a "implicit declaration of function `int usleep (...)'"
> error.  It doesn't seem to be defined anywhere in:

> #include <unistd.h>

Oh, I didn't see that one.

But anyway, with and without that list my example still
compiles, compiling with "gcc-cris -mlinux -o us us.c".

Later you wrote:
> Could the problem be that it's a C++ (.cc extension) program?  The
> directives are wrapped within an
> extern "C" {}

No 'extern "C"' wrapping is necessary.  I still can't get the
compilation to fail the way you , even changing to be a .cc C++
file and compiling it with g++-cris.

How did you compile?  If you used some specific options or rule
before, that compile rule in your makefile might need tweaking.

mvh H-P