I have some legacy code to reuse written in c++ with opengl but most of the examples online are written in objective c… so porting my code would be probably easier in a mixed env.
I would prefer to avoid a “library” solution with separated .so
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can. Just add your c++ code in a file called *.cpp
You can even mix C++ and objective-c code in the same file, but make sure the file is named *.mm (instead of *.m). That’s a gotacha that a lot of people fall far.
Considering you want to use some legacy C++ code, this is probably exactly what you are looking for: Sample code from Apple for Cocoa With Carbon or CPP