Import third-party libraries unknown type name ' NSString ' solution

Source: Internet
Author: User
Tags ziparchive

Adding third-party libraries The general steps are three-step:

1) Drag the Library folder, copy a copy to join your own project

2) Add the frame or dynamic link library required by the library

3) Modify the compiler properties under Arc-fno-objc-arc

But join Ziparchive today, follow the steps to add, add libz dynamic Library, modify-fno-objc-arc to report 23 errors (Khan too many errors emitted, stopping now), are expected Identifier or ' (', Unknown type name ' NSString ', could not build module ' Foundation ', could not build module ' UIKit '.

Through Baidu, StackOverflow found the solution:

In your project PCH file, do the following with your #import header file:

#ifdef __objc__

#import

#endif

Analysis, Ziparchive Library is C OC C + + file mixed, PCH inside the header file is global, when the C file import is actually meaningless, that is, the source of the problem, so to OBJC district separately compiled, so always solve.

Import third-party libraries unknown type name ' NSString ' solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.