Re: help with g++ 2.96

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

 



On Mon, Sep 22, 2003 at 11:31:05AM -0600, lrtaylor@xxxxxxxxxx wrote:

> Is it a C header?  If so, try surrounding your include statement with
> 'extern "C" {' and '}' like this:
> 
> extern "C" {
> #include <incfile.h>
> }
> 
> This will cause that file to be compiled as C source code rather than
> C++ source code, which must follow stricter rules.

Not quite, the C++ syntax and semantics still apply, but the linking
convention is changed to "C".  Usually, it is possible to include a C
header this way, but additional care is necessary if the header uses C++
keywords.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux