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.

C/C++ > Problems with GBFS (newb q)

#2812 - Robin - Thu Feb 13, 2003 2:32 am

Before I start, many thanks to Tepples for this package, if I can get it working it'll be most useful :)

OK, first my setup. I'm trying to use GBFS to provide script and graphics data for a generic GBA RPG engine. I'm using HAM as a development library, and VisualHAM for my IDE.

I'm trying to include gbfs.h and libgbfs.c in my main program, but when I try and build I get a load of errors like:

Quote:
In file included from main.cpp:5:
libgbfs.c: In function `const void* gbfs_get_obj(const GBFS_FILE*, const char*, u32*)':
libgbfs.c:108: cannot convert `void*' to `GBFS_ENTRY*' in assignment
libgbfs.c:102: warning: `GBFS_ENTRY*here' might be used uninitialized in this function


Now, I've never tried to code in C or C++ before (I've had a Java background) so excuse me being an utter newbie but I think my problem stems from GBFS being C code, and me trying to code in C++ (I'm trying to keep my project object oriented). gcc will compile both C and C++ right? If so, can I use C libraries like GBFS in a C++ program? Am I on completely the wrong track and there's an obvious answer? If this is impossible are there any plans to port GBFS to a C++ codebase, or any alternative packages in C++ that perform a similar function?

Sorry for all the questions, and thanks for your time ^_^