gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > SDL, fm-099, sqrt, sin, cos

#151928 - nczempin - Thu Mar 06, 2008 9:12 pm

I got the SDL port mostly running, and the next step for me was to to compile Paul Robson's Football Manager.

When linking, I got error messages for the following functions missing:
sqrt, sin, cos.

This is with the 1.4.4 devkitProUpdater version of devkitPro.

I seem to recall something about those routines being overhauled, will it help to update to 1.4.5 (for some reason the updater doesn't work over my wifi access, so I'd have to either manually dl the relevant stuff or wait until I get back to a DSL line)?

I tried to check the code briefly, but it all seemed to be in order (I didn't have the source for devkitARM though)

Any pointers as to what I should do?

#151938 - tepples - Thu Mar 06, 2008 10:00 pm

Try adding -lm to the libraries in the makefile.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#151940 - nczempin - Thu Mar 06, 2008 11:13 pm

tepples wrote:
Try adding -lm to the libraries in the makefile.


Umm, wow, that did the trick, thanks.

So what should I have done to know this without having to ask??

#151997 - wintermute - Fri Mar 07, 2008 11:54 pm

nczempin wrote:


So what should I have done to know this without having to ask??


Hard to say really, some people seem to pick this stuff up by osmosis, others need to be told. It's probably covered in some programming guide somewhere.

A quick google for the error can often shed light

http://www.google.co.uk/search?q=undefined+reference+to+sin
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#152018 - nczempin - Sat Mar 08, 2008 12:13 pm

wintermute wrote:
nczempin wrote:


So what should I have done to know this without having to ask??


Hard to say really, some people seem to pick this stuff up by osmosis, others need to be told. It's probably covered in some programming guide somewhere.

A quick google for the error can often shed light

http://www.google.co.uk/search?q=undefined+reference+to+sin


Sure, normally I would google immediately, but this is such a generic error, and the solution was very DS-specific too.

It seems that a lot of information is actually available, and scattered. Something like a Wiki for DS homebrew, answering all the question someone like me would have (which tutorials are up-to-date? which OS apps/games/libs have already been ported? etc. etc.) would be great; it probably exists and I missed it, or didn't look hard enough.

Since I've already pinned you down, what would be the best way to file an an enhancement request for devkitPro? I originally had trouble getting the devkitpro updater working over a public wifi line, perhaps in combination with some firewall etc. settings on my vista machine (that inetc update attempt never finished; sometimes it went to the next step of installing, sometimes it didn't. It would be great if there were an option "install only", when you could download on a separate machine. I'd even help implement it.

#152022 - tepples - Sat Mar 08, 2008 1:45 pm

nczempin wrote:
Sure, normally I would google immediately, but this is such a generic error, and the solution was very DS-specific too.

There are a lot of other platforms that use GCC or other Unix-style compiler toolchains. Many of those require the use of -lm for sin, cos, log, and other transcendental functions.

Quote:
It seems that a lot of information is actually available, and scattered. Something like a Wiki for DS homebrew, answering all the question someone like me would have (which tutorials are up-to-date?

There are supposed to be wikis on dev-scene.com and tobw.net, but I haven't taken a long look at their breadth or depth.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#152026 - wintermute - Sat Mar 08, 2008 3:05 pm

nczempin wrote:


Sure, normally I would google immediately, but this is such a generic error, and the solution was very DS-specific too.


I'm not really sure how you see the solution as DS specific, using functions from math.h & not linking against libm will give you link errors on pretty much anything.

Quote:

It seems that a lot of information is actually available, and scattered. Something like a Wiki for DS homebrew, answering all the question someone like me would have (which tutorials are up-to-date? which OS apps/games/libs have already been ported? etc. etc.) would be great; it probably exists and I missed it, or didn't look hard enough.



Dev Scene is probably the closest we have for something like that. The biggest problem we have in the homebrew scene is that people who know what they're doing tend to just get on with it and the people who don't, insist on writing crap tutorials.

The devkitpro wiki is in progress over at http://wiki.devkitpro.org . This is intended more for toolchain and support library documentation than the specifics of particular implementations on the various supported platforms though. Right now there's not a lot of content but that will change gradually over the coming months.


Quote:

Since I've already pinned you down, what would be the best way to file an an enhancement request for devkitPro? I originally had trouble getting the devkitpro updater working over a public wifi line, perhaps in combination with some firewall etc. settings on my vista machine (that inetc update attempt never finished; sometimes it went to the next step of installing, sometimes it didn't. It would be great if there were an option "install only", when you could download on a separate machine. I'd even help implement it.


Such an option already exists, see http://wiki.devkitpro.org/index.php/Getting_Started
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#152124 - nczempin - Mon Mar 10, 2008 1:47 pm

tepples wrote:
nczempin wrote:
Sure, normally I would google immediately, but this is such a generic error, and the solution was very DS-specific too.

There are a lot of other platforms that use GCC or other Unix-style compiler toolchains. Many of those require the use of -lm for sin, cos, log, and other transcendental functions.


And I'm aware of this now. I will be on the lookout for the more general problems; it just never occurred that this could be anything but a DS-specific problem.

#152125 - nczempin - Mon Mar 10, 2008 1:54 pm

wintermute wrote:
nczempin wrote:


Sure, normally I would google immediately, but this is such a generic error, and the solution was very DS-specific too.


I'm not really sure how you see the solution as DS specific, using functions from math.h & not linking against libm will give you link errors on pretty much anything.



You're right; no idea what I was thinking.

Quote:


Quote:

It seems that a lot of information is actually available, and scattered. Something like a Wiki for DS homebrew, answering all the question someone like me would have (which tutorials are up-to-date? which OS apps/games/libs have already been ported? etc. etc.) would be great; it probably exists and I missed it, or didn't look hard enough.



Dev Scene is probably the closest we have for something like that. The biggest problem we have in the homebrew scene is that people who know what they're doing tend to just get on with it and the people who don't, insist on writing crap tutorials.



I can see that. Right now I'm in the stage of finding out; once I've found out, I'll likely just get on with it. Just leaving a trail of annoying forum questions behind will hopefully at least let the next person with the exact same problem find the solution more quickly.

Quote:


The devkitpro wiki is in progress over at http://wiki.devkitpro.org . This is intended more for toolchain and support library documentation than the specifics of particular implementations on the various supported platforms though. Right now there's not a lot of content but that will change gradually over the coming months.


Quote:

Since I've already pinned you down, what would be the best way to file an an enhancement request for devkitPro? I originally had trouble getting the devkitpro updater working over a public wifi line, perhaps in combination with some firewall etc. settings on my vista machine (that inetc update attempt never finished; sometimes it went to the next step of installing, sometimes it didn't. It would be great if there were an option "install only", when you could download on a separate machine. I'd even help implement it.


Such an option already exists, see http://wiki.devkitpro.org/index.php/Getting_Started


Ah, yes, of course I noticed there was a "download only" option on the devkitupdater, but for some reason the actual offline installer has problems "just" installing, hanging without timeout in the inetc plug-in etc.

There is simply no option to "just install", or, put in other words, "I have no internet connection, please don't try to connect".

Or perhaps it was specifically on my Vista machine that this approach had problems. I can help isolate the problem if you want.

#152714 - wintermute - Wed Mar 19, 2008 11:30 pm

Aha, curse the search option on this forum, found this post again at last though.

nczempin wrote:

Ah, yes, of course I noticed there was a "download only" option on the devkitupdater, but for some reason the actual offline installer has problems "just" installing, hanging without timeout in the inetc plug-in etc.

There is simply no option to "just install", or, put in other words, "I have no internet connection, please don't try to connect".

Or perhaps it was specifically on my Vista machine that this approach had problems. I can help isolate the problem if you want.


I must admit I don't actually posess a machine with no net connection atm so I've been testing by blackholing the url for the online ini file. It's conceivable there might be something I've missed if the machine in question has never been configured for internet access.

The source for the NSIS installer is available in CVS in the installer module. Feel free to have a play and submit a patch if you find something.

http://devkitpro.cvs.sourceforge.net/devkitpro/installer/
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#152740 - HyperHacker - Thu Mar 20, 2008 9:03 am

Well you could just unplug the cable, or in Windows disable the connection. :P
_________________
I'm a PSP hacker now, but I still <3 DS.