[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: [rtl] Questions about compiling RT-linux codes using g++
>>>>> "wangsg" == wangsg <wangsg@ercrms33.engin.umich.edu> writes:
wangsg> Hello,
wangsg> Our group tried rt-linux recently, and can not get our C++
wangsg> program works. The problem is when we tried to insmod the
wangsg> object code, it gave all rt function calls (rt_task_init,
wangsg> rt_task_wait, ...) as unresolved symbols.
wangsg> Can anyone tell me what's wrong with it and how to fix it? Or
wangsg> g++ is totally not usable for rt-linux?
You need to put extern "C" around the includes that declare those rt
functions. The undefined symbols you got were the C++ "mangled" names
that include argument types in the string. Plain old C doesn't do
that.
Ideally, any C include file, such as the rt .h files, should have
something like this in it:
#ifdef __cplusplus
extern "C" {
#endif
<body of file>
#ifdef __cplusplus
}
#endif
That way it will compile correctly with either compiler.
paul
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail majordomo@rtlinux.cs.nmt.edu OR
echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.cs.nmt.edu
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/