"undefined reference to `__udivsi3'"

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
M-374 LX
Very interested
Posts: 61
Joined: Mon Aug 11, 2008 10:15 pm
Contact:

"undefined reference to `__udivsi3'"

Post by M-374 LX »

If I try to do a division and compile, I get the following message:

Code: Select all

undefined reference to `__udivsi3'
What is the solution?
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

What tool do you use to compile your source ? the function should be included in sega.s boot file.
M-374 LX
Very interested
Posts: 61
Joined: Mon Aug 11, 2008 10:15 pm
Contact:

Post by M-374 LX »

Stef wrote:What tool do you use to compile your source ? the function should be included in sega.s boot file.
I use GCC under Linux.

The problem seems to be solved by linking one of the GCC libraries.

I found an "ldiv" label in the startup code.
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

Oh yeah you may need the libc as well the sega.s header.
Post Reply