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]

Re: linking problem.


On Tue, 2002-11-19 at 15:16, jameshq@liverpool.ac.uk wrote:
> Hi all:
>    I wrote a additional file call hal_aux.c in the /hal/ directory and
> set it compiled in the *.cdl file.
> 
> hal_aux.c
> 
> void testfun(void)
> {
>    cyg_uint32 a = 1000;
> 
> }
> 
> 
> and when I call testfun()  in the kapi.cxx file inside
> cyg_thread_create() as:
> 
> in kapi.cxx file
> 
> extern void testfun(void);
> cyg_thread_create(xxx)
> {
> xxx
>    testfun();
> xxx
> }
> 
> I can build the ecos library without problem, but when I try to
> compile the user programe and link with the ecos library it generates
> a error says the testfun is not defined. so how can I solve it problem
> thanks a lot.

Try 'externC void testfun(void);'

-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------


-- 
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]