I added .h/.cpp files with C functions to my Xcode project. How would I call a C function in an objective-C function?
When I included the C file (#import “example.h”) in the app delegate header file it exploded with errors (could be that it treated the cpp file as objective-c) even though it compiles fine without being included/imported.
Thanks
Edit: Renaming all the files from m to mm fixed the issue. However I am getting a linker error when building (ld: duplicate symbol)… Better research this first. Thanks again all.
If you want to use C++ with your Objective-C module, change the file extension from
.mto.mm.