开发者

Porting C++ game to objective C [closed]

开发者 https://www.devze.com 2023-04-03 16:42 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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")

0

精彩评论

暂无评论...
验证码 换一张
取 消