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

Re: tcgetattr



> It seems that the functions 
> 	tcgetattr(...)
> 	tcsetattr(...)
> 	cfgetispeet(...)
> 	etc.
> defined in <termios.h> are not supported by uC-linux. 
> (undefined reference to `_tcgetattr__FiP7termios)

Are you using these functions from a C++ program? It certainly looks like 
you are from the C++ mangled name of the undefined reference.

If you are using C++, you may need to bracket many of the system include 
files (the ones which are written in C) with extern "C" {...}, for example

extern "C" {
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
// etc...
}

Some of the include files already are bracketed internally with 

// someheaderfile.h
#ifdef __cplusplus
extern "C" {
#endif

...

// normal header contents

...

#ifdef __cplusplus
}
#endif

so that when compiled with a C++ compiler the compiler knows that the 
functions declared in the file use C linkage rather than the default of 
C++ linkage.

A useful task for someone (perhaps the library owner) might be to add such 
bracketing to the rest of the includes, where appropriate.

-- 
Patricia Travers
TeleDesign PLC