EmbDev.net

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


von Sla (Guest)


Rate this post
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 ?

von Martin Thomas (Guest)


Rate this post
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

von Sla (Guest)


Rate this post
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.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.