coco2dx新建项目报错,ld: -pie can only be used when targeting iOS 4.2 or later clang: error: linker command

在新建cocos2d-x以后,执行发现下面错误:

ld: -pie can only be used when targeting iOS 4.2 or later

clang: error: linker command failed with exit code 1 (use -v to see invocation)

如图所看到的:


技术分享

这时候,选中左上角的项目文件 ——>选中General ———> DeploymentInfo 中 ————-> Deployment Target,

然后把里面的4.0改成对应的版本号,这样再又一次编译,如:

技术分享

改动以后,如图所看到的:

技术分享

然后再又一次编译,就发现成功了:

技术分享

好,希望能帮到大家!