views:

84

answers:

1

Hi everyone,
I have run into a problem... I'm trying to use QTKit in an application that we have at work. The only problem with that is the app is written in C++, not Obj-C. I have looked through Apple's documentation for answers, but I haven't found anything useful.

Basically what I'm looking to do is write a single controller class in Obj-C that has its methods exposed through a C interface to my app. I've written all that code already, but when I try and link it to even a sample C++ app, it finds the Obj-C symbols in the lib and complains about them being there. I thought about hiding the symbols using compiler flags, but I saw in Apple's docs that Obj-C isn't affected by that, since classes and messages are bound by the runtime and not the linker.

Has anyone successfully done this?

Thanks, Robbie

+2  A: 

You can use QTKit from within your C++ application by using to Objective-C++:

Rename the files that access QTKit from .cpp to .mm. This does not change anything in your existing code but you can then use Objective-C from within these files.

Nikolai Ruhe
I would prefer to stay away from Objective-C++ if possible. The code is share between windows and linux also, so I'd like to just have a C interface.
Robbie
You have to separate the QTKit parts from the platform independent parts anyway. You can put the platform specific parts in mm files because they would not compile on other platforms. But it sounds like you want to insert an abstraction layer to facilitate adoption of different video APIs next to QTKit. That makes sense.
Nikolai Ruhe