This is the mail archive of the ecos-discuss@sourceware.org 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: printf


On Wed, May 10, 2006 at 12:29:44PM +0200, Emmanuel Viollet wrote:
> Hi (again... ;) )
> 
> I know I must be becoming a bit of a pain, but eCOS is really new to me, 
> and I'm sometimes quite lost...
> 
> I'm having trouble compiling the following program :
> /* this is a simple hello world program */
> #include <stdio.h>
> 
> int main(void)
> {
> printf("Hello, eCos world!\n");
> return 0;
> }
> 
> Compilation works fine. But the linker complains that printf() is missing.

eCos is made of packages. The libc is made from a number of such
packages: CYGPKG_LIBC_I18N, CYGPKG_LIBC_SETJMP CYGPKG_LIBC_SIGNALS 
CYGPKG_LIBC_STARTUP CYGPKG_LIBC_STDIO CYGPKG_LIBC_STDLIB
CYGPKG_LIBC_STRING CYGPKG_LIBC_TIME.
  
Normally you use a templete to select a group of packages. eg there is
the net template, the posix template, the minimal template, the
default etc. Most templetes contain all of libc. The exceptions are
stubs and cygmon and redboot (which you shouldn't use for application
anyway), minimal, lwip_ppp, lwip_eth.

lwip_* only contain the part of libc they actually need, ie strings.
If you want stdio, you need to add the package
CYGPKG_LIBC_STDIO. Alternatively, just use diag_printf() which always
exists.

        Andrew



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