| View previous topic :: View next topic |
| Author |
Message |
Piker
Joined: 05 Feb 2007 Posts: 2
|
Posted: Sat Jan 17, 2009 1:38 am Post subject: Compilation problems |
|
|
When I try to compile and a file has a division, ej: int i = 300 / 100;
the linker shows an error of undefined reference to `__divdi3' function.
I'm using VLF library of Dark_Alex, if anyone know the solution, please reply.
Makefile
| Code: |
TARGET = PSPasswordv2
OBJS = crt0.o main.o
INCDIR = ../../include
CFLAGS = -O2 -G0 -Wall -fshort-wchar -fno-pic -mno-check-zero-division
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS) -c
LIBDIR = ../../lib
LDFLAGS = -mno-crt0 -nostdlib -nodefaultlibs
LIBS = -lvlfgui -lvlfgu -lvlfutils -lvlflibc
PSP_FW_VERSION = 500
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = PSPassword v2
BUILD_PRX = 1
PSPSDK=$(shell psp-config --pspsdk-path)
include ./build.mak
|
And here is the error:
| Code: |
[...]
int i, percent, cpercent, total_percent = 0;
char tmp = 0x0;
archivo.tamf = sceIoLseek(archivo.fd, 0, SEEK_END);
sceIoLseek (archivo.fd, 0, SEEK_SET);
percent = archivo.tamf/100;
cpercent = (percent = archivo.tamf / 100);
[...]
|
Thanks. |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
Posted: Sat Jan 17, 2009 12:36 pm Post subject: |
|
|
Well, you've told the compiler to eliminate any standard libraries and compiler support libraries (for any good reason?), but the compiler doesn't know - it clearly needs a support function called __divdi3 to help it do the divide instead of emitting instructions inline. Either you must supply it yourself, or set the linker up differently, or tell the compiler not to generate those calls, or don't do division.
Jim _________________ http://www.dbfinteractive.com |
|
| Back to top |
|
 |
Piker
Joined: 05 Feb 2007 Posts: 2
|
Posted: Mon Jan 19, 2009 8:30 am Post subject: |
|
|
The VLF library has its own libc library version(vlflibc) then you have to include that library and exclude the original one. The Makefile is a copy(90%) of the Makefile used to compile the example provided with the library. It seems to be OK.
I supose the VLF library doesn't include that function or library so it is a problem of the D_A library, but i don't know.
I tried to compile removing the LDFLAGS line too, but i only got more errors.
I'm blocked.
Thanks by the response.
Piker. |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Wed Jan 28, 2009 8:20 am Post subject: |
|
|
| __divdi3 is defined in libgcc.a |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Wed Jan 28, 2009 10:16 am Post subject: |
|
|
| Whoops! Wrong thread. :) |
|
| Back to top |
|
 |
|