This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
mix use between C++ and C in eCOS. Thanks
- From: "QiangHuang" <jameshq at liverpool dot ac dot uk>
- To: "Ecos-Discuss" <ecos-discuss at sources dot redhat dot com>
- Date: Fri, 25 Apr 2003 10:05:13 +0100
- Subject: [ECOS] 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