forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compilation problems

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Piker



Joined: 05 Feb 2007
Posts: 2

PostPosted: Sat Jan 17, 2009 1:38 am    Post subject: Compilation problems Reply with quote

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
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Sat Jan 17, 2009 12:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Piker



Joined: 05 Feb 2007
Posts: 2

PostPosted: Mon Jan 19, 2009 8:30 am    Post subject: Reply with quote

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
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Wed Jan 28, 2009 8:20 am    Post subject: Reply with quote

__divdi3 is defined in libgcc.a
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Jan 28, 2009 10:16 am    Post subject: Reply with quote

Whoops! Wrong thread. :)
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group