I am converting c++ code to the objective c. The original code i开发者_StackOverflow社区ncludes many "dll" files in it. How can I port C++ dlls to objective C. I want to your explanation in detail. Hope for you.
You can not 'port' dlls. You can however port the code that generated them. You can either try that, if you have the code for those dlls, or you can see if equivalent libraries exist on mac, with functions that have the same interface they had in the dlls. This might be true for runtimes and ported libraries.
Without source code, I am afraid you can't port the dll files.
See How to convert C++ Code to C, since objective C is supposed to be a strict super set of C (according to http://en.wikipedia.org/wiki/Objective-C#Syntax), this should work in theory (assuming you have the code).
Note that automatically porting the code is not enough if your code depends on anything external (e.g. platform dependent) - you'll have to do that separately.
It is often simpler to wrap the code instead of port it (i.e. call the C++ code from your objective C program using a mechanism such as a DLL or extern "C")
精彩评论