This will not work, or at least not be portable. The only really really obvious thing is to make your C ++ program so that you can access these functions.
You cannot "use" C ++ code from C code for obvious reasons. You don't have access to object-oriented functions, so a ton of things won't work: constructors, destructors, move / copy semantics, and virtual inheritance are probably the biggest things you will miss. (This is right: you cannot correctly create or destroy objects if they do not have trivial constructors and destructors.)
You will also encounter communication problems: C ++ function names are crippled in a mess, including their parameter types and return types and classes, which will look like __1cGstrcpy6Fpcpkc_0_ . It would be technically possible to declare distorted function names in C to use them, or use dlsym to get a pointer to them, but that is just plain stupid. Do not do this.
If you need to create a function in C ++ that must be called from C, you can specify it as extern "C" , and its name will not be distorted, and it will be accessible from C, and he will be able to use the capabilities of C ++ :
extern "C" void Foo() { std::string hello = "Hello world!"; std::cout << hello << std::endl; }
Then you need to declare it on the C side of your program as follows:
void Foo();
And you can call it.
You can wrap all your C ++ calls that you want to open for your C program in extern "C" functions, and return a pointer to your type and deal with it this way, but it is very annoying very quickly, you really should just use c ++.
Regarding the connection with the static library, in Xcode go to the settings of your project, select the target, go to the "Phase assembly" tab, expand the "Link binary files to libraries" section and omit the .a file.