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]

mix use between C++ and C in eCOS. Thanks


Hi all:
    I got the a question:

//========================================================
c_file.h

void test_fun(void);
//========================================================

//========================================================
c_file.c

void test_fun(void)
{
  //do something here
}
//========================================================

//========================================================
cplusplus_file.hxx

#include <c_file.h>
//========================================================


//========================================================
cplusplus_file.cxx

void myfun(void)
{
   // do something here

   // call the function defined in the C file
   test_fun();
}
//=========================================================


I can build the eCOS library without problem but when I link my application
with the library I got the problem: "undefined reference to test_fun()"

I think this should be a C/C++ linkage problem, but I don't have clue. Can
anybody give me help on this issue? 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]