iOS Build failed

iOS Build failed
0.0 0

#1

I build for iOS Cocos Creator ver.1.6.1.
My PC is mac10.13.3.
Occurs error When compile iOS.
How to build success?

** BUILD FAILED **

The following build commands failed:
CompileC build/cocos2d_libs.build/Debug-iphonesimulator/libcocos2d\ iOS.build/Objects-normal/i386/CCFileUtils.o /Users/UserName/Desktop/jsb-default/frameworks/cocos2d-x/cocos/platform/CCFileUtils.cpp normal i386 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Build failed: Take a look at the output above for details.


#2

There should be more information in the build log just above that.

Given this happens in CCFileUtils.cpp, I suspect it’s related to the system calls, as I had this problem too. If this is what you’re encountering, your options are:

  1. Edit the file to remove references to system() calls on iOS
  2. Work with target older versions of the iOS SDK where the call still exists (this is pretty awkward if you’ve already updated your phone and mac)
  3. Wait for the cocos2d-x team to fix it

#3

xikka Thanks!!

/Users/username/Desktop/jsb-default/frameworks/cocos2d-x/cocos/platform/CCFileUtils.cpp:1291:9: error: call to unavailable function ‘system’: not available on iOS
if (system(command.c_str()) >= 0)
^~~~~~
In file included from /Users/username/Desktop/jsb-default/frameworks/cocos2d-x/cocos/platform/CCFileUtils.cpp:1:
In file included from /Users/username/Desktop/jsb-default/frameworks/cocos2d-x/build/…/cocos/platform/ios/cocos2d-prefix.pch:6:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdlib.h:94:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk/usr/include/stdlib.h:195:6: note: candidate function has been explicitly made unavailable
int system(const char *) __DARWIN_ALIAS_C(system);
^
1 warning and 1 error generated.

my devise already updated…(´༎ຶོρ༎ຶོ`)