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

RE: [rtl] C++ compiling problem



Thanks for the reply David.
However, I still have a problem.

I tried compiling your examples/cpp program and it fails with the message...
...linux/inlude/asm/system.h:153: parse error before '::'

David

-----Original Message-----
From: David Olofson [mailto:david.olofson@reologica.se]
Sent: 10 October 2001 19:26
To: rtl@fsmlabs.com
Subject: 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 -'
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/