0

Is it possible to include a C header file for a dylib into an Objective-C project when the functions for the dylib include references and default parameters. For example

extern "C" {
unit32_t GetThisReference(uint32_t & theRef);
unit32_t ThisFunctionHasDefaults(uint32_t aparm, uint32_t one = 1, uint32_t two = 2);
};

Thanks!

1
  • 1
    extern "C" and default parameters and references make your example look like C++, not C. Commented Mar 18, 2012 at 22:06

2 Answers 2

4

References and default parameters are features of C++, not C. You could try compiling the file as Objective C++ (by changing the extension to .mm).

Sign up to request clarification or add additional context in comments.

Comments

1

Including C libraries is straightforward as Objective C is merely a superset of plain C. But as far as I know, C functions do not have default values. Are you sure that you don't mean a C++ library? In that case, you may want to call the library functions from an Objective-C++ file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.