[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] C++ compiling problem
On Wednesday 10 October 2001 19:22, David Hamilton wrote:
> I tried writing some simple apps in C++, and the compiler produces
> errors. This can be re-produced by simply renaming the hello.c example
> hello.cpp and trying to compile.
> There is something about conflict between C and C++ linkage in linux
> kernel headers.
> Anybody got any ideas.
> Is there a general problem developing RTLinux apps in C++ !???
You must tell the compiler that the kernel headers are written in C by
putting 'extern "C" {...}' around the #include directives. (Or the C++
compiler will assume that the function prototypes are to be interpreted
as C++, which results in different symbol names and possibly even
different calling conventions.)
//David Olofson --- Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------------> http://www.linuxdj.com/maia -'
.- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`-------------------------------------> http://olofson.net -'