Gareth
Gareth

Reputation: 121

iOS project fails to compile under xcodebuild for deployment target 7.0, but is fine for 6.0. Compiles for both under Xcode

I have an iOS project that has iOS 6.0 as a deployment target. It builds fine both under Xcode and xcodebuilder (necessary for CI). However the client now wants the project to only be available for users who have iOS7+ installed.

No problem, I'll just increase the deployment target number right? Wrong!

Under Xcode the project continues to compile just fine. Under xcodebuild however, the project fails to compile with lots of errors like this:

Undefined symbols for architecture armv7:
"std::string::_Rep::_S_empty_rep_storage", referenced from: in drmNativeInterface

It's using Adobe Primetime and drmNativeInterface is part of that.

To help isolate the problem I've created a brand new, single-screen project and performed the following changes:

Other than those few steps above, the project is stock single-screen: no code has been added.

Xcode will compile it but xcodebuild will not. For xcodebuild to compile it I have to switch the deployment target to 6.0 which defeats the client's request.

The CI xcodebuild command contains a few params but here's the minimised command I'm using for this test project:

xcodebuild -project "MyProject.xcodeproj" -scheme "MyProject"

I've tried adding FRAMEWORK_SEARCH_PATHS, HEADER_SEARCH_PATHS and ALWAYS_SEARCH_USER_PATHS params in case xcodebuild was simply unable to use the paths contained within the project file but that made no difference.

If I remove the drmNativeInterface framework from the project - leaving the 2 Apple-based dependencies alone - the project compiles just fine for both Xcode and xcodebuild. But obviously this isn't a solution because I need that framework!

Does anyone have any idea what could be causing this or how to fix it?

**NB: **

There are a lot of questions on SO where projects will build in Xcode and not in xcodebuilder, but I couldn't find any where a project will build in xcodebuilder just fine for one deployment target and not for another.

Thanks in advance.

Upvotes: 0

Views: 2052

Answers (2)

ChenYilong
ChenYilong

Reputation: 8673

You lose the libstdc++6.dylib in Link Binary With Libraries Just add it like : enter image description here

Upvotes: 1

Gareth
Gareth

Reputation: 121

Linking the libstdc++ library (in this case, libstdc++6.dylib to be exact) fixed the problem.

Upvotes: 1

Related Questions