I have an open source C++ project. My aim is now to extend this project with additional code. This code is Objective-C code (because I don’t know C++). I have already found a way to call an Objective-C function from a C++ class (Calling Objective-C method from C++ method?)
But, when I try to compile my C++ code with XCode, XCode freezes (no error during the building phase). My question is if it is even possible to call an Objective-C class out of a project that is only written in C++.
Has anyone had some experiences with that?
Xcode freezing is definitly a bug, it should compile or give an error. Try switching to another compiler in your project settings.
As long as the c++ code is compiled in objective-c++ mode it should work. AFAIK it will only compile in objective-c++ mode if the file extension is .mm or if you explicitly tell the compiler. Commandline switch for both gcc and clang is -ObjC++