开发者

How can I import compiled C++ libraries into an Objective-C++ project in Xcode 4?

I'm trying to use the Skyp开发者_StackOverflow中文版eKit SDK to create an Objective-C++ project using Xcode 4. I have two compiled libraries from SkypeKit, libskypekit_cyassl_lib.a and libskypekit_cppwrapper_2_lib.a, which I need to be able to use so as to access the Skype API.

I've added in both .a files under 'Linked Frameworks and Libraries' and added -all_load -ObjC -lstdc++ to the 'Other Linker Flags', and that builds okay, but as soon as I try to use any of the methods in those libraries, building fails.

Any help would be greatly appreciated, thank you!


You can call C++ code from Objective-C++, which means that your files should have the .mm extension instead of .m

I assume that this could be the issue, but since you did not specify the errors you get it is just a guess. Specifically, if you call C++ code from a .m file you get compilation errors.

Another possible cause is forgetting to import the header files of the library. For the import to be successful, you also have to add the directory where the headers are to your project "header search path".

If this does not help, please post the error message.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜