This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Inter-package visibility
- From: "Michele Portolan" <michele dot Portolan at imag dot fr>
- To: <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 24 Mar 2004 14:25:30 +0100
- Subject: [ECOS] Inter-package visibility
Hi,
I defined package of mine, but I cannnot use it inside other eCos
pre'existent ones.
I have:
a configuration header: <pkgconf/mypkg.h>
a module header and relative source file: mymodule.h and mymodule.c
inside I have only one function: void myfunction(void)
in mymodule.h i defined it as "extern" (I saw it done in some examples, like
errno.h/errno.c)
I all compiles fine: I tried to modify the hellowerld program and I an able
to call my function:
>/* this is a simple hello world program */
>#include <stdio.h>
>#include <mymodule.h>
>int main(void)
>{
> printf("Hello, eCos world\n");
> myfunction();
> return 0;
>}
I then tried to use it inside the scheduler (my real goal) in the same way
(#include <mymodule.h> ) but it doesn't work! eCos compiles just fine but
when I try to use it to compile a HelloWorld it tells me:
>prove_conf_install//lib/libtarget.a(kernel_sched.o): In function `global
destructors keyed to 11000.cyg_scheduler_sched_lock':
>/ecos-c/cygwin/opt/ecos-2.0/packages/kernel/v2_0/src/sched/sched.cxx:104:
undefined reference to `myfunction(void)'
>collect2: ld returned 1 exit status
>make: *** [test_config] Error 1
What is the problem? Please help, I am completely blocked!
Thanks everyone,
Michele Portolan
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss