Mixing NSObjects with SDK

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

shadlx

  • Posts: 5
  • Joined: Tue Nov 03, 2020 1:59 pm
  • Real Name: Richard Williamson

Mixing NSObjects with SDK

PostMon Jul 11, 2022 8:20 pm

Hello

I'm integrating the Desktop Video SDK into an existing Objective C application and am having some odd difficulties getting everything to play nicely

I suspect I am doing something dumb.. What I'm finding is, for example:

- I have a header file: "BMDevice.h"
- after #pragma once I "#include "DecklinkAPI.h"
- I declare my class: "@interface BMDevice : NSObject"
- I create a instance variable "IDeckLink *device;"

I get an error "Unknown type IDeckLink"

Ah I think,
- I remove the #include for the DecklinkAPI.h
- I do a forward declaration of the class - "@class IDeckLink;"
- I add "#include "DecklinkAPI.h" to the top of my implementation file (.mm)

Now when I try to access an object of the IDecklink class in the .mm file I get the error "incomplete definition of type 'IDecklink'"

I am pretty sure I am missing something obvious - I have tried various iterations on the #import/#include variety but can't seem to get it to line up!
Offline

shadlx

  • Posts: 5
  • Joined: Tue Nov 03, 2020 1:59 pm
  • Real Name: Richard Williamson

Re: Mixing NSObjects with SDK

PostMon Jul 11, 2022 8:56 pm

And of course almost as soon as i post this I work out how to fix it (although I'm not totally clear why) - it seems that any other class which interacts with the SDK also needs to be an objective c++ class - so changing to .mm appears to solve it. hmm

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 13 guests