This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Inter-package visibility
- From: Bart Veer <bartv at ecoscentric dot com>
- To: michele dot Portolan at imag dot fr
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Wed, 24 Mar 2004 14:13:27 +0000 (GMT)
- Subject: Re: [ECOS] Inter-package visibility
- References: <00f401c411a3$7aca0d60$6c81ab93@TIMAQLF129>
>>>>> "Michele" == Michele Portolan <michele.Portolan@imag.fr> writes:
Michele> Hi,
Michele> I defined package of mine, but I cannnot use it inside other eCos
Michele> pre'existent ones.
Michele> I have:
Michele> a configuration header: <pkgconf/mypkg.h>
Michele> a module header and relative source file: mymodule.h and mymodule.c
Michele> inside I have only one function: void myfunction(void)
Michele> in mymodule.h i defined it as "extern" (I saw it done in some examples, like
Michele> errno.h/errno.c)
<snip>
Michele> What is the problem? Please help, I am completely
Michele> blocked!
At a guess the problem is caused by C vs. C++ linkage. The kernel is
written in C++ so by default it will expect myfunction() to be a C++
function, not a C one. In mymodule.h use externC instead of extern.
externC is a macro defined in cyg/infra/cyg_type.h which will do the
right thing irrespective of whether you are compiling C or C++ code.
Bart
--
Bart Veer eCos Configuration Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss