Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2020-12-16 17:41:57

LegolandoBloom
New member
Registered: 2020-12-16
Posts: 5

Undefined Global error

Hello Gameboy Developer forum, I'm new to programming and to this forum. I have been following Harward's CS50x lessons and completed the part about C. So when I saw a youtube video called "write your own gameboy games in c" I though that would be such an awesome way to practice C.

I have been trying to create the movement mechanics of a motorcyle with gbdk, and after fixing all(hopefully) my syntax errors I got 6 very similar errors that I have no clue what they mean:

?ASlink-Warning-Undefined Global '___fssub' referenced by module 'main'

?ASlink-Warning-Undefined Global '___fsmul' referenced by module 'main'

?ASlink-Warning-Undefined Global '___fsadd' referenced by module 'main'

?ASlink-Warning-Undefined Global '___sint2fs' referenced by module 'main'

?ASlink-Warning-Undefined Global '___fs2sint' referenced by module 'main'

?ASlink-Warning-Undefined Global '___fsdiv' referenced by module 'main'


The compiler does manage to create an asm file but no gb output file. I can post the code, but I dont know how to put the text in a scrollable box(like I have seen on other posts) so if you could please tell me that would be great.

Offline

 

#2 2020-12-17 02:32:59

toxa
Member
Registered: 2020-02-13
Posts: 304

Re: Undefined Global error

That means you can’t use floating point math.

Offline

 

#3 2020-12-17 11:24:11

LegolandoBloom
New member
Registered: 2020-12-16
Posts: 5

Re: Undefined Global error

Is this because of the gbdk? So what I need to do is make the thing with whole numbers? I'll try it and let you know. Thanks!

Edit: Wow it finally compiled, thank you so much toxa!

Last edited by LegolandoBloom (2020-12-17 12:05:25)

Offline

 

#4 2021-01-27 18:12:49

kalt
New member
Registered: 2021-01-26
Posts: 7

Re: Undefined Global error

you could convert it to integer math or fixed point math. alternatively, you could implement those functions and assign them the appropriate symbols. But if you are just learning C that would probably be difficult.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson