This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]