"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 » Fri Aug 02, 2013 10:38 pm

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 » Tue Aug 13, 2013 11:54 am

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 » Wed Aug 14, 2013 10:14 pm

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 » Sat Aug 17, 2013 10:44 pm

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

Post Reply