简体   繁体   中英

Calling C++ cocoa touch static library from iphone app

I have developed a very simple C++ based cocoa touch static library and a simple touch based application which includes this library.

The application gives compilation error "Undefined symbol" corresponding to the librarie's function being called. ld: symbol(s) not found.

But if I make C based cocoa touch static library, (with same functionality), the application is successfully built and runs fine.

What can be the issue? Is C++ based cocoa touch library NOT ALLOWED ?

Thanks

The library has .cpp and .h source code, and test application had .m files. It was giving compilation error. To fix this , I just changed file extension of .m files to .mm in my test application. And it compiled, linked and ran successfully. Thanks

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