3

I have static library target, which uses Foundation classes(NSArray,etc) . I want to use this static library in Command line tool target. The command line tool contains only C files. From command line tool I want to call a method exported in static library. So I have modified header search path and linked the static library. When I compile the command line tool it is following linker errors.


Undefined symbols:
"_OBJC_CLASS_$_NSMutableArray", referenced from:
"_objc_msgSend", referenced from:
What is the method to link a static library which uses Foundation classes from a command line tool which contains C files?

Regards

Devara Gudda

1 Answer 1

2

Add the Foundation framework to your project and to the Link Libraries build phase in your target. The easiest way to do the latter is to Get Info on the target; there's a list of linked libraries on the General tab of that window.

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

1 Comment

Thanks for your response. Linking against the Foundation framework will solve the problem but I don't want to link Foundation framework to my Command line tool. I intended to develop Command line tool as platform independent. The static library will be platform specific. I am trying to figure out how to avoid linking Foundation framework in command line tool.

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.