简体   繁体   中英

Adding 3rd party c++ library into objective C project

我有第3方静态库。它仅包含(.h和.hpp)头文件。它们是C ++语言的。但是我的项目使用的是目标C。我可以在我的项目中使用这些库吗?在我的目标c项目中调用c ++函数。

Yes, you can do that. C++ is fully supported in Objective-C. Just rename the relevant Objective-C implementation files from .m to .mm , and they start to be compiled as C++ now, instead of “plain C mode.” These .mm files can directly call your C++ code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM