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 > GBFS and C++

#57396 - omaremad - Sat Oct 15, 2005 3:31 pm

Hello this may be a noob queation.

ok i have gbfs and it works fine with c files
Howver i want to use clasess in my game so i change the file extention to C++.

now to load a gbfs file i use the const char=getgbfsobj method
but now in c++ the compiler say in valid conversion from const void to const char

if in c mode now error comes up but in cpp the error appears any work around?

any one got gbfs working with c++?

#57413 - tepples - Sat Oct 15, 2005 6:11 pm

In C++, you will need to reinterpret_cast the result of GBFS functions explicitly.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#57435 - omaremad - Sat Oct 15, 2005 8:57 pm

thnx
but can any one clarify how?

#57436 - Mighty Max - Sat Oct 15, 2005 9:00 pm

omaremad wrote:
thnx
but can any one clarify how?


yes, just put "(const char *)" infront of that parameter. This is the explizit cast from whatever 32 bit value to const char *
_________________
GBAMP Multiboot