0

C programming in IOS?

Hi,

I am implementing an image editing program in C which should work both in Windows, IOS (iDevices). Ths point is that we do not want to re-write same code in Object-C or Xcode.

Let's say that we have a C program that is just resizing an input image by half. The program should be with some OpenCV librarie files.
We know it can be compiled and built in Windows with MinGW. But is there a way to compile and build same project files to run within iDevices? (This is supposed to be called from an iPhone application.)

Help!

2
Contributors
2
Replies
7
Views
5 Years
Discussion Span
Last Post by 9tontruck
0

Have you tried using blocks? They allow you to embed C code in what is essentially a black box routine. It's not going to cross-compile a C program to Obj-C, but if your goal is to reuse some existing code, this may do the trick. Here are some articles on blocks:

http://pragmaticstudio.com/blog/2010/7/28/ios4-blocks-1
http://pragmaticstudio.com/blog/2010/9/15/ios4-blocks-2

However, if all you are doing is resizing an image, there is enough sample code out there to get the job done quickly in Obj-C. Just search on 'iOS resize an image'. Good luck!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.