0

From this question it appears it's possible (but perhaps with issues). My question is, can I do this the other way aorund, compile a C/C++ lib in Visual Studio then link it up to xcode and run it on an iOS device. Will Apple have an issue with this if it actually works? I know they're not big fans of DLLs and I'm not too keen on linking up and developing tech around something which Apple can detect and ban (like they do with dynamically linked libraries).

Community
  • 1
  • 1
meds
  • 21,699
  • 37
  • 163
  • 314

3 Answers3

2

You can't do this because the Microsoft compiler targets a different architecture from the architectures that iOS runs on. And that's just for starters. There are no doubt a gazillion other reasons that it won't work, but the architecture is the most obvious block.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
2

The question you mentioned concerns two different compilers on the same platform. That reasoning does not apply to two different compilers to two different platforms.

The answer is that you can't do that. Compilers on the Windows platform will make use of runtime libraries that are specific to the Windows platform and that are not available for iOS. So, even if you could solve the compiler-interoperability problem (this is the "DLL part" of your question), there would be this major blocking point.

sergio
  • 68,819
  • 11
  • 102
  • 123
1

No.

The question you are refering to is about using files generated by different compilers but for the same platforms.

What you are talking about is using a library generated for a platform and use it with a different OS an even a different architecture (unless it is a Mac on a x86). No way.

You may try if you find some compiler that targets (generates code for) the destination platform. That way, you could build it in a PC but the result file would only work on a Mac (or whatever your target platform is).

SJuan76
  • 24,532
  • 6
  • 47
  • 87