Error in linking

Guest #1172181
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 ?
Guest #1172182
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
Guest #1172183
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.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.