Ive recently downloaded this libary, and it is excellent.
unfortunatly the game I wish to use it in uses c++ instead of straight c. Is there a way for the libary to compile for c++.
thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
-
2004-11-20
Most development environments will be happy to link object files or libraries made from C code with other object files or libraries made from C++ code. Some slightly special stuff is necessary in the header files, but PMASKs headers should already contain the necessary stuff (an extern "C" statement in an ifdef __cplusplus at the top, and a close curly brace in a similar ifdef at the bottom).
If you wanted to, you could probably also compile PMASK as C++ code instead of C code (just rename the .c files to .cpp) - I think the PMASK code already includes the things necessary for that (explicit pointer casts on void pointers, that kind of thing). But that shouldn't be necessary.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ive recently downloaded this libary, and it is excellent.
unfortunatly the game I wish to use it in uses c++ instead of straight c. Is there a way for the libary to compile for c++.
thanks
Most development environments will be happy to link object files or libraries made from C code with other object files or libraries made from C++ code. Some slightly special stuff is necessary in the header files, but PMASKs headers should already contain the necessary stuff (an extern "C" statement in an ifdef __cplusplus at the top, and a close curly brace in a similar ifdef at the bottom).
If you wanted to, you could probably also compile PMASK as C++ code instead of C code (just rename the .c files to .cpp) - I think the PMASK code already includes the things necessary for that (explicit pointer casts on void pointers, that kind of thing). But that shouldn't be necessary.