This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
user defined C++ function in eCOS question? Thanks a lot.
- From: <jameshq at liverpool dot ac dot uk>
- To: ecos-discuss at sources dot redhat dot com
- Date: Tue, 22 Apr 2003 17:33:47 +0100
- Subject: [ECOS] user defined C++ function in eCOS question? Thanks a lot.
Hi all:
I tried to use C++ function in C but I encounter the following
problem:
(What I trying here is to define some C++ functions(because I need to
access the class object)
and to be called in C, as kapi.cxx, kapi.h)
File: a.h
void create_obj();
File: a.cxx
#include <cyg/io/a.h>
externC void create_obj()
{
int a;
}
while I tried to build the ecos library I got the following error
message:
/ecos-c/ecoscvs/current/src/a.cxx:3: syntax error before `void'
It seems the externC keyword is not recognized here.
what happen here?
BTW what is the difference between externC and extern "C"?
Thanks a lot.
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss