public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] printf
@ 2006-05-10 10:30 Emmanuel Viollet
  2006-05-10 10:41 ` AW: " Ram Sudhir Tadavarthi
  2006-05-10 10:54 ` Andrew Lunn
  0 siblings, 2 replies; 3+ messages in thread
From: Emmanuel Viollet @ 2006-05-10 10:30 UTC (permalink / raw)
  To: ecos-discuss

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.
How are the different parts of the C library defined? I suppose that 
it's possible to implement a subset of the ANSI specifications, but I 
can't find how this is done in the configuration tool.
Any links?

In advance, thanks.

-- 
Emmanuel Viollet
Software engineer
Webdyn
e-mail : Emmanuel.Viollet@webdyn.com
Tel    : +33 (0)1 39 04 29 55


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* AW: [ECOS] printf
  2006-05-10 10:30 [ECOS] printf Emmanuel Viollet
@ 2006-05-10 10:41 ` Ram Sudhir Tadavarthi
  2006-05-10 10:54 ` Andrew Lunn
  1 sibling, 0 replies; 3+ messages in thread
From: Ram Sudhir Tadavarthi @ 2006-05-10 10:41 UTC (permalink / raw)
  To: Emmanuel.Viollet; +Cc: ecos-discuss

Hi,

Send the make files/ compiling /linker options you are using to understand
whats the problem.

I hope you have linked with "-LINSTALL_DIR/lib -Ttarget.ld -nostdlib" where
INSTALL_DIR is the path for your install directory.

If you still have problems post it here.

Regards,
ram  

-----Ursprüngliche Nachricht-----
Von: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] Im Auftrag von Emmanuel
Viollet
Gesendet: Mittwoch, 10. Mai 2006 12:30
An: ecos-discuss@ecos.sourceware.org
Betreff: [ECOS] printf

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.
How are the different parts of the C library defined? I suppose that 
it's possible to implement a subset of the ANSI specifications, but I 
can't find how this is done in the configuration tool.
Any links?

In advance, thanks.

-- 
Emmanuel Viollet
Software engineer
Webdyn
e-mail : Emmanuel.Viollet@webdyn.com
Tel    : +33 (0)1 39 04 29 55


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


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] printf
  2006-05-10 10:30 [ECOS] printf Emmanuel Viollet
  2006-05-10 10:41 ` AW: " Ram Sudhir Tadavarthi
@ 2006-05-10 10:54 ` Andrew Lunn
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2006-05-10 10:54 UTC (permalink / raw)
  To: Emmanuel Viollet; +Cc: ecos-discuss

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-10 10:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-10 10:30 [ECOS] printf Emmanuel Viollet
2006-05-10 10:41 ` AW: " Ram Sudhir Tadavarthi
2006-05-10 10:54 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).