PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Can i use C..?

I have a C library i wrote some years back and i wish to use to write some PPC apps.

Can i use C for development using embedded tools as when i compile i get a stack of errors, but if i change the file extension to cpp then i only get a few bugs, but some of the C interfaces conform to C and i do not wish to change them. IS there a way i can compile files with the c extension
Are you getting errors during compilation, or trying to link to C routines? You can mix and match, as long as any header files you include in your C implementation conform to C. You may have to cast functions (extern "C", etc), to properly link between C and C++.

Dan East
I have some C interfaces and when i add the gx.h file i get error error C2061: syntax error : identifier 'GXGetDisplayProperties' i cannot understand why as when i name the c interface file to a cpp it compiles
When i declare this in a c file

typedef struct icdc2d_Surface* icdc2d_Surface;

i get this error

error C2040: 'icdc2d_Surface' : 'struct icdc2d_Surface *' differs in levels of indirection from 'struct icdc2d_Surface'

even if i inset extern "C"
I had to modify gx.h to build with Pocket Quake, which is straight C. I had to add "struct" in front of a few vars. I think it was lines 56 and 57.

Dan East