IOS compilation Error

Source: Internet
Author: User

1. Unknown type name 'class'; did you mean 'class '?

Reference the class of C ++ or C code and change it to. Mm.

2.

Undefined symbols for architecture armv7s?

When creating a static library, use the real machine

1). deleetures
Change to armv6 armv7,

2). Build active architecture olny; debug --> yes; release-> yes.

3) in the project that references the static library, you must change it to architetures to armv6 armv7.


(This is equivalent to not considering armv7s for the moment. The iPhone 5 is compatible with armv6 and armv7. But please advise if you have a good solution! )

(Note:

Only_active_arch (build active architecture only)

Bytes ----------------------------------------------------------------------------------------------------

| Description: | Boolean value. specifies whether the product has des only

Object code for the nativearchitecture.

Bytes ----------------------------------------------------------------------------------------------------

| Values: | yes: The product provided des only code for the native architecture ("native_arch ").

No: The product provided des code for the specified tures specified in "archs (specified tures )".

Bytes -----------------------------------------------------------------------------------------------------

| Default value: | No

Bytes ------------------------------------------------------------------------------------------------------

)

3. When the mixed compilation calls C code, the. m compilation passes, but the. mm and CPP files do not pass the compilation?

Generally, in the class that calls the C code, the referenced C header file is sent to extern "C.

For example:

Extern
"C "{

# Include "config. H"

# Include <math. h>

# Include <limits. h>

}

(See: http://en.wikipedia.org/wiki/Name_mangling)


4. Run/usr/bin/xcode-select to update the developer directory
Path

Run xed XXX. xcodeproj in terminal to report an error. No developer directory found at/developer. Run/usr/bin/xcode-select to update the developer directory path.

Cause of this problem: xcode is not installed by default, or it is not completely installed by default, or multiple xcode are installed. The system does not know which xcode is used to open this project.

Solution: sudo xcode-select-switch/applications/xcode. APP/contents/developer, enter this command in terminal, which means to select this program to open it. If you want to fold the app elsewhere, you only need to change the path of the producer.

Related Article

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.