简体   繁体   中英

iOS Xcode: building a 32-bit project with a 32-bit/64-bit subproject

I have a number of iOS Xcode projects that all use the same subproject. This subproject builds a static library, that's then linked to the master project. Up until now this subproject and all master projects have been 32-bit.

I want to build a new project with 64-bit support, so have set the architecture to "armv7, armv7s, arm64".

Of course, I had to update the shared subproject to "armv7, armv7s, arm64" as well.

Everything builds fine.

However, now when I build old 32-bit-only projects to run on 64-bit devices it fails, because Xcode builds a 64-bit non-fat version of the static library from the subproject, which it can't link to.

Is there a way to tell Xcode (linker flag?) to build and link to the 32-bit version of the subproject, because the master project is 32-bit?

Thanks,

Russell.

Answer was that I had "Build Active Architecture Only" set to Yes in the subproject by mistake, causing it to always build a thin library. Setting to no, builds a thick lib with all supported architectures, meaning it'll work with a parent 32-bit project!

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