Fwd: [arm-gnu] printf problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: [arm-gnu] printf problem



hi,

In my case the problem is with sprintf(). Is this function also hardware
specific?
In my code, i have used sprintf() like this

void fun1()
{
  char buf[100];
  ......
  ......
  ......
  sprintf(buf, "Hello world\n");
  ......
  ......
}

When I use sprintf(), i got errors like
** undefined reference to __write
** undefined reference to __read
** undefined reference to __open
** undefined reference to __lseek
** undefined reference to __fstat
** undefined reference to __makebuf
** undefined reference to __errno

I really have no idea whether sprintf(), is also a hardware specific
function.

If have provided dummy functions  for all the errors like below, and the
build is successful.

__write()
{
  return 0;
}

When I ran my program, it is hung inside the sprintf().

kindly help me out with this issue.


Regards,
Ravi


On Fri, Mar 14, 2008 at 9:51 AM, Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
wrote:

> ravi wrote:
>
> > I too have same problem and couldn't fix those. I have installed
> > ***arm-2007q3-53-arm-none-eabi.exe*** from codesourcery.
> > The <newlib> mentioned in the below mail be installed along with
> > codesourcery or do I have to install it separately?
>
> Newlib is included in every release.  It's the C library.  However, you
> will have to provide functions like "open" and "write" for your target
> board since correctly implementing those functions depends on the
> hardware on your target.
>
> --
> Mark Mitchell
> CodeSourcery
> mark@xxxxxxxxxxxxxxxx
> (650) 331-3385 x713
>



-- 
regards
ravi



-- 
regards
ravi