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: simple question..


YHChou@viatech.com wrote:


Hi,

I have created one header file and two c file as below,

test.h
int add(int a, int b);

test1.c
#include "test.h"
int add(int a, int b)
{
   return a + b;
}

test2.c
#include "test.h"
void sample(void)
{
   int i;
    i = add(3, 4);
}

I create test1.o and test2.o first. but I can create not the execution file. the function can not
be linked together.. what is the problem?

You need an entry point like main() probably.


Jifl
--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine


-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]