EmbDev.net

Forum: ARM programming with GCC/GNU tools Error in linking


Author: Sla (Guest)
Posted on:

Rate this post
0 useful
not useful
My project - work witch jpg files - compress/decompress

Function give error > from free jpglib >
jpeg_create_compress(&zip_cinfo);

Make all >
Linking: main.elf
.
.
.
.
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int 
erwork\libc.a(tmpnam.o):
In function `worker':
tmpnam.c:(.text+0x32): undefined reference to `_open_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int 
erwork\libc.a(tmpnam.o):
In function `_tempnam_r':
tmpnam.c:(.text+0xa4): undefined reference to `_getpid_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int 
erwork\libc.a(tmpnam.o):
In function `_tmpnam_r':
tmpnam.c:(.text+0x10c): undefined reference to `_getpid_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int 
erwork\libc.a(fopen.o):
In function `_fopen_r':
fopen.c:(.text+0x2c): undefined reference to `_open_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int 
erwork\libc.a(remove.o):
In function `_remove_r':
remove.c:(.text+0x2): undefined reference to `_unlink_r'
collect2: ld returned 1 exit status
make: *** [main.elf] Error 1

If compili this project in IAR, no Error.
What lib use for correct this error ?
Who type in makefile ?

Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 useful
not useful
Sla wrote:
> My project - work witch jpg files - compress/decompress
>
> Function give error > from free jpglib >
> jpeg_create_compress(&zip_cinfo);
>
> Make all >
> Linking: main.elf
> .
> .
> .
> .
> c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int 
erwork\libc.a(tmpnam.o):
> In function `worker':
> tmpnam.c:(.text+0x32): undefined reference to `_open_r'
> c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int 
erwork\libc.a(tmpnam.o):
> In function `_tempnam_r':
> tmpnam.c:(.text+0xa4): undefined reference to `_getpid_r'
> c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int 
erwork\libc.a(tmpnam.o):
> In function `_tmpnam_r':
> tmpnam.c:(.text+0x10c): undefined reference to `_getpid_r'
> c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int 
erwork\libc.a(fopen.o):
> In function `_fopen_r':
> fopen.c:(.text+0x2c): undefined reference to `_open_r'
> c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib/thumb/int 
erwork\libc.a(remove.o):
> In function `_remove_r':
> remove.c:(.text+0x2): undefined reference to `_unlink_r'
> collect2: ld returned 1 exit status
> make: *** [main.elf] Error 1
>
> If compili this project in IAR, no Error.
> What lib use for correct this error ?
> Who type in makefile ?

It seems that the library uses some kind of file-access and you need to
interface your storage-driver (maybe some kind of FAT-library) to the
newlib's stdio-functions. Please read the chapter about system-calls in
the newlib-documentation. libnosys and libfat from the devkitpro-Project
should give an idea how the newlib to driver-interfaceing can be done.

It might be easier to replace the stdio-functions which own functions
(i.e. with functions provided by the embedded file system library efsl).

Martin Thomas

Author: Sla (Guest)
Posted on:

Rate this post
0 useful
not useful
Ok.
Im' see devkitpro and this code in stdio.h for psp:

************************************************************************
#include_next <stdio.h>

#if __SSP_FORTIFY_LEVEL > 0

#include <stdarg.h>

#undef sprintf
#undef vsprintf
#undef snprintf
#undef vsnprintf
#undef gets
#undef fgets

#define snprintf(str, len, ...) \
  __builtin___snprintf_chk (str, len, 0, __ssp_bos (str), _VA_ARGS_)
#define vsnprintf(str, len, fmt, ap) \
  __builtin___vsnprintf_chk (str, len, 0, __ssp_bos (str), fmt, ap)

************************************************************************

e.t.c. >

#undef standart stdio function ADN #define correct function for ARM

?
Sla.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.