【总结】Xcode编译问题整理

cocos2dx-3.17.2 ---- xcode 14.0.1 项目移植 cocos2dx 3.17.2 移植 Xcode14.0.1 阅读详情


【说明】

本文整理自己在Xcode使用过程中遇到的问题,主要是编译中的问题及解决方法。


【问题】


问题描述:在向Cocos2d-x引擎代码中添加自定义类的时候,类文件已经引入(导入到工程),但是Xcode编译时依然报错。

错误信息:”undefined symbols for architecture XXX: "XXX", referenced from:XXX.”

问题原因:这是由于Xcode没有自定将类引入项目造成的,通常这个过程是Xcode在引入时自动完成。

解决方案:将类文件手动添加到项目,转到Cocos2d_libs项目的 “Build Phases” 选项,在 ”Compile Sources“ 中添加自定义类的cpp 文件即可。


问题描述:Cocos2d-x3.x在xcode6中编译可能报以下错误。

错误信息:"_fwrite$UNIX2003","_strerro$UNIX2003","_opendir$INODE64"等

解决方案:将 “fileadp.c” 文件引用到项目中即可,文件见附录。

错误截图:






【附录】


fileadp.c
// cocos2d-x3.1在xcode6中编译可能报以下错误:"_fwrite$UNIX2003","_strerro$UNIX2003","_opendir$INODE64",
// 只需要在工程中引入此文件即可解决。
// #if defined (__unix) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#if defined(__APPLE__) || defined(__unix)

#ifndef __ENABLE_COMPATIBILITY_WITH_UNIX_2003__
#define __ENABLE_COMPATIBILITY_WITH_UNIX_2003__

#include <stdio.h>
#include <dirent.h>

FILE *fopen$UNIX2003( const char *filename, const char *mode )
{
    return fopen(filename, mode); 
}

size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d )
{
    return fwrite(a, b, c, d); 
}

char *strerror$UNIX2003( int errnum )
{
    return strerror(errnum);
}

DIR *opendir$INODE64(const char * a)
{
    return opendir(a);
}

struct dirent *readdir$INODE64(DIR *dir)
{
    return readdir(dir);
}

#endif
#endif





Xcode Build Setting 整理(一) 文章目录基本概念最终取值`Build Settings``Architectures` 架构`Base SDK` (SDKROOT)`Additional SDKs` (ADDITIONAL_SDKS)`Supported Platforms` (SUPPORTED_PLATFORMS)`Architecures` (ARCHS)`Valid Architectures` (VALID_ARCHS)`Build Active Architecture Only` (ONLY_ACTIVE_ARCH)`Ass 阅读详情

相关推荐

OpenSSL 1.0.2o iOS静态库编译实战:从configure到lipo合并

在软件开发中,静态库与动态库是两种常见的代码封装方式。静态库在编译期被完整链接进可执行文件,具有启动快、部署简单、符号可控等优势,在iOS平台上尤为常见。而交叉编译则是为不同CPU架构(如arm64、x86_64)生成可执行代码的关键技术,需要借助Xcode工具链和SDK环境完成。这一技术广泛应用于金融支付SDK、即时通讯模块以及需要对SSL/TLS协议进行精细控制的应用中。对于仍依赖旧版加密接口的存量项目,在iOS端编译OpenSSL 1.0.2o为静态库(libcrypto.a、libssl.a)是平衡

weixin_42526166的博客 257

Xcode常见编译失败问题解决方案

常见错误一:Apple Mach-O Linker Error Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1发生这种错误的原因通常是因为项目中存在同名类造成链接错误。 有可能是你存在两个类名称都一样,也可能是因为你在不同的.m文件中定义了同样的const

冰凉的枷锁的博客 4624

高版本Xcode 中 创建 C++ Class

前言: Xcode 在升级之后没有Create C++ class了,但是C++ Class确实太方便了,但是看到很多人在问这个问题,问就上传了这个。 使用方法: 1)下载zip 2)解压 3)打开Xcode包内容 4)复制到/Contents/Developer/Library/Xcode/Templates/File Templates,中随便一个目录,或者你创建一个目录 5)这样就可以创建C++ Class了,如果快捷栏中没有,就右键 new。

Xcode 编译系统的编译过程及原理

任何 iOS 源代码在设备上运行之前都需要编译器的一系列处理,这个过程通常由 Xcode Build System 完成。在这篇文章中,我将介绍 Xcode Build System 的每一个部分。 为何要学编译知识 说说 OCLint 、SwiftLint 实现原理是怎样的? 如何编写 Clang 插件? Obfuscator-LLVM 在 iOS 中如何实现混淆加固? iOS 中 Bitcode 到底是如何优化 IPA 包的? 如果以上问题你都可以说个大概,请忽略本文,如果你对以上...

程序猿老樊的博客 2659

如何利用三阈值游程理论识别干旱事件_python

如果当前时间点与上一个干旱事件的结束位置相隔不超过一个月(`index - current_event['end_index']

weixin_44259522的博客 1945

Renesas:定时器输入捕获

一、PWM输入捕获 1、Smart Configurator配置 注意:在使用前,需要使能对应的定时器!否侧无法正常进行输入捕获! 2、脉冲宽度的获取 如何区分高低电平的脉冲宽度:最常用的方法就是在触发中断后,判断IO口的高低电平,来确认是上升沿触发的中断还是下降沿触发的中断。 若无法进入中断,可查看:Renesas:配置中断的常规流程 (1)中断方式(Smart Configurator生成的代码) #pragma interrupt r_Config_TAUB0_0_i...

不吃鱼的猫的博客 2481

Xcode 中的编译过程以及编译器

Xcode的编译过程: 基本步骤大概可以分为4个: (1).预处理(Pre-process):把宏替换,删除注释,展开头文件,产生.i文件 (2).编译(Compliling):把之前的.i文件转换成汇编语言,产生.s文件 (3).汇编(Asembly):把汇编语言文件转换为机器码文件,产生.o文件 (4).链接(Link):对.o文件中的对于其他的库的引用的地方进行引用,生成最后的可执行文件(同时也包括多个.o文件进行 link) 通过解析 xcode 编译 log,可以发现...

程序猿老樊的博客 2507

Qt C++:跨平台开发利器

摘要: Qt C++是基于C++的跨平台开发框架,通过元对象系统、信号槽机制及模块化架构实现"一次编写,多端部署"。核心特性包括: 跨平台能力:覆盖桌面(Windows/macOS/Linux)、移动端(iOS/Android)、嵌入式及WebAssembly; 信号与槽:替代传统回调,实现对象间高效通信; UI组件库:200+预制组件支持QSS样式定制; 工具链:Qt Creator集成开发环境提供可视化设计、调试及多平台编译。 广泛应用于工业控制、车载系统、医疗设备及跨平台应用开发,

2202_75382767的博客 1682

xcode编译问题汇总

记录自己遇到过的xcode奇怪编译问题 1.xcode真机编译时报png图片的错误 原因1. 是提示的png并不是ps导出的png,而是手动修改jpeg后缀名为png,在模拟器上不会报错,但在真机,不能识别这种所谓的“png”图片。 原因2:这是因为png图片的问题,png图片在存储的时候有一个NOT INTERLACED/INTERLACED(无交错/交错)的选项,因为设计师在切图的时...

498

如何手动打包Linux(麒麟系统)的Qt程序

Qt在windows上有自带的windeployqt来帮助打包程序,但是对于linux系统来说Qt并没有自带对应的打包程序。尽管存在开源的linuxdeployqt打包程序,但是在使用的过程中会出现很多问题,对于arm架构的系统来说需要编译并修改源码等等。确定你程序所需要的插件,然后将你使用的Qt版本对应的插件复制到plugins里边。你可以根据各个库后面的路径来找到对应的库,并将它们全部复制到之前创建的lib目录下。复制你的可执行程序到bin目录下(将 your_executable。

qq_45903233的博客 3608

华为OD机试真题 新系统 2026-04-26 Python&JS 实现【最大化游戏试玩资格分发】

新研发了一台游戏设备可以面向用户接受试玩。现有 n 个试玩申请,每个试玩有开始时间和结束时间。作为协调员,为了能让更多人体验到游戏,你需要对试玩申请进行选择,使得:

MISAYAONE的博客 290

XCode编译出错问题整理

1.引入第三方库SDWebImager编译报错: Undefined symbols for architecture i386:   "_OBJC_CLASS_$_MKAnnotationView"   解决方法:引入mapkit和imageIO 两个framework

greatwang123的专栏 595

《UDS协议从入门到精通》系列——图解0x27:安全访问

什么是安全访问服务?应用场景和基本原理是什么?全网最直观详细的图解UDS-0x27:安全访问服务!!

车载系统攻城狮 7233

Xcode中关于已删除图片或文件 编译出现CpResource或者CopyPNGFile can't find file的错误...

Xcode中关于已删除图片或文件 编译出现CpResource或者CopyPNGFile can't find file的错误 今天整理项目,准备把未用到的png给删了,结果 编译出现CopyPNGFile error找不到文件 和 CpResource error ,No such file or directory等错误。仔细检查发现图片确实删了,代码中相关的代码也都修改掉...

weixin_30323961的博客 142

LSTM 深度解析从原理推演到现代序列建模的演进

LSTM(Long Short-Term Memory,长短期记忆网络)是一种特殊的递归神经网络(RNN),它通过引入记忆单元(Cell State)来解决普通RNN在长序列数据处理中的梯度消失问题。LSTM可以在长时间的序列中捕捉依赖关系,是一种非常适合处理时间序列、自然语言处理、语音识别等任务的深度学习模型。在LSTM中,记忆单元(Cell State)是一个贯穿整个序列的数据通道,用于存储和传递关键信息。记忆单元在LSTM的时间步之间保持信息的持久性,可以看作是一个长期记忆的“容器”。

hello.reader 3万+

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Flutter 遇到的问题整理

Flutter 遇到的问题整理

qq_43383334的博客 2769

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

UI控件问题和XCode编译警告和错误解决方法集锦 (持续更新ing)

UI控件问题集锦 第一 图片无法在UIImageview上显示: 原因如下: 1.没有设置宽高(或者宽高为0) 2.位置不对 3.hidden=YES 4.没有添加到控制器的view上面 第二 一个UIScrollView无法滚动: 1.contentSize没有值 ———》打印下有没有出来尺寸,如果出来尺寸,就是没有问题,没有出来就是这个有问题 NSLog(...

weixin_30340819的博客 201

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Xcode升级常常遇到警告错误的解决方法

Xcode 升级后,常常遇到的遇到的警告、错误,解决方法 从sdk3.2.5升级到sdk 7.1中间废弃了很多的方法,还有一些逻辑关系更加严谨了。 1,警告:“xoxoxoxo”  is deprecated 解决办法:查看xoxoxoxo的这个方法的文档,替换掉这个方法即可。 2,警告:Declaration of "struct sockaddr" will not be visi

devileatapple的专栏 1081

Iphone CodeSign error: no provisioning profile at path 错

今天在退房手续,变化了profile,当再次进行整理编译项目时。就出现了这个问题,在xCode 6 开发环境下出现了, 出现这个错误提示Code Sign error: Provisioning profile XXXX can't be found 经查找 找到解决方式与大家共享,解决方式例如以下: 1.先copy上面那行出错信息,然后关闭这个项目,打开finder到你的项目文件xx...

weixin_33911824的博客 83

使用Flutter相关问题

dart run build_runner build --delete-conflicting-outputs : 运行。flutter是一个能开发ios、android、web三端的框架,使用dart语言。flutter doctor -v:查看flutter运行环境状态。中声明的所有依赖包到本地缓存,并生成包索引文件。​ 工具,执行项目中所有配置的代码生成器(如。​ 国际化(i18n)包的 CLI 工具,flutter pub get:下载。说明Xcode 实际上。

YoruXD的博客 286

Xcode添加文件:Reference、Copy、Move三选项底层原理与避坑指南

在iOS开发中,工程文件管理是构建可维护项目的基础,而Xcode在添加文件时弹出的三个选项——Reference files in place、Copy files to destination、Move files to destination,常让初学者甚至经验开发者踩坑。理解其底层原理,本质是文件引用与物理存储的关系:Reference仅记录路径,不复制文件,适合跨项目共享但易因路径漂移导致编译失败;Copy生成独立副本,保证团队协作与项目迁移安全;Move移动原件,适合整理项目结构但具有破坏性。围绕

weixin_30096975的博客 346

[每日100问][2011-8-26]iphone开发笔记,今天你肿了么

[url=http://www.buildapp.net/iphone/show.asp?id=2500]IOS 5.0[/url] [url=http://www.buildapp.net/iphone/show.asp?id=2499]急阿,为啥升级了xcode之后编译的app打包ipa错误?[/url] [url=http://www.buildapp.net/ipho...

iteye_10490的博客 261

常用代码块260923

测试开屏广告ID:ca-app-pub-3940256099942544/5575463023,修复UIScene配置问题,确保单场景模式正常运行。针对YYText编译报错,通过修改YYTextLayout.m文件中的正则表达式逻辑并禁用位码(ENABLE_BITCODE=NO),同时设置iOS部署目标为15.0,成功解决编译错误,提升项目兼容性与稳定性。

酒鬼 13

MacTeX与TeXstudio安装指南:从零开始配置LaTeX环境

本文提供了一份详细的MacTeX与TeXstudio安装配置指南,帮助Mac用户从零开始搭建LaTeX环境。文章涵盖了MacTeX完整版的下载安装、TeXstudio编辑器的安装与关键配置(如设置XeLaTeX为默认编译器),并指导用户创建第一个包含中文和数学公式的LaTeX文档,同时给出了常见问题的解决方案,旨在让用户快速上手并高效使用LaTeX进行学术写作与排版。

ss78901的博客 951

使用#pragma编译器指令在Xcode中整理代码

#pragma 开头的代码是一条编译器指令,并不保证它能适用于所有的编译器或其它环境。

痴_Pro的博客 697
上一篇: 【存储】Cocos2d-x使用JsonCpp
下一篇: 【加密】Cocos2d-x PNG图片资源加密(修改版)
ldp晴天
博客等级 码龄17年 18粉丝 15原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值