【COCOS2DX-LUA 脚本开发之七】解决( ERROR IN FUNCTION ‘ADDCHILD’. ARGUMENT #2 IS ‘XX’; ‘CCNODE’ EXPECTED. )异常报错的方法

简介:
本站文章均为  李华明Himi 原创,转载务必在明显处注明: 
转载自【黑米GameDev街区】 原文链接:  http://www.himigame.com/lua-game/1306.html

前几篇向童鞋们介绍了如何利用tolua++工具制作自己的pkg,也就是自定义类,那么其中有的童鞋遇到Lua如下错误信息:

 

此问题主要由于 pkg 书写格式出现的问题,例如当你有一个自定义的Layer,假设MyLayer:

以上代码为错误形式,在pkg中应该如下方式书写:

 

     代码简单很容易看出来区别,是的在pkg文件中继承时请将“双冒号”去掉!

至于前端你是否使用 public::CCLayer 都是无所谓的,没有任何区别,没有错的。

具体原因不多说,请童鞋们自行看文档:http://www.codenix.com/~tolua/tolua++.html#classes

 


相关文章
|
11月前
|
API C++
【Azure 环境】VS Code登录China Azure(Function)报错 An error occurred while signing in: invalid_request - AADSTS65002
An error occurred while signing in: invalid_request - AADSTS65002: Consent between first party application 'c27c220f-ce2f-4904-927d-333864217eeb' and first party resource '797f4846-ba00-4fd7-ba43-dac1f8f63013' must be configured via preauthorization - applications owned and operated by Microsoft mus
502 13
|
11月前
|
缓存 开发工具 C++
VS Code调试Function报错|无法加载Diagnostics.Abstractions怎么办?
在调试 Azure Function 时,可能出现 “Could not load file or assembly 'Microsoft.Extensions.Diagnostics.Abstractions, Version=8.0.0.0'” 错误,导致主机启动失败。本文详细解析该依赖加载错误的成因,并提供基于不同安装方式(NPM 或 MSI)的解决方案,涵盖重装 Core Tools、清理缓存、检查 .NET SDK 版本等操作步骤,同时提供日志排查与 Docker 容器化替代方案,帮助开发者快速恢复本地调试流程。
404 0
|
网络协议 API 网络安全
【Azure Function App】发现部分请求Function App遇见 403.72 报错(请求Body>100KB)
在调用Azure Function的HTTP Trigger时,发送POST请求偶尔出现403错误,且响应为空、Header信息少。经排查发现,当请求Body大于100KB时会触发403.72错误,原因是启用了“Client Certificate mode”为“Optional Interactive User”。解决方法是将该模式设置为“Ignore”。由于TLS重新协商机制限制,大请求体无法正常处理,导致此问题。
338 1
【Azure Function】Function App出现System.IO.FileNotFoundException异常
Exception while executing function: xxxxxxx,The type initializer for 'xxxxxx.Storage.Adls2.StoreDataLakeGen2Reading' threw an exception. Could not load file or assembly 'Microsoft.Extensions.Configuration, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the
403 64
|
Java Windows
【Azure Function】部署Java Function失败:报错deploy [ERROR] Status code 401和警告 'China North 3' may not be a valid region
1:deploy [ERROR] Status code 401, (empty body). 2: China North 3 may not be a valid region,please refer to https://aka.ms/maven_function_configuration#supported-regions for values. 3:  <azure.functions.maven.plugin.version>1.36.0</azure.functions.maven.plugin.version>
506 11
|
域名解析 缓存 网络协议
优化Lua-cURL:减少网络请求延迟的实用方法
优化Lua-cURL:减少网络请求延迟的实用方法
|
JavaScript Linux 数据中心
【Azure Function App】解决Function App For Container 遇见ServiceUnavailable的异常
【Azure Function App】解决Function App For Container 遇见ServiceUnavailable的异常
239 3
【Azure Function App】解决Function App For Container 遇见ServiceUnavailable的异常
|
网络协议
Lua中实现异步HTTP请求的方法
Lua中实现异步HTTP请求的方法
|
Linux Python
【Azure Function】Python Function部署到Azure后报错No module named '_cffi_backend'
ERROR: Error: No module named '_cffi_backend', Cannot find module. Please check the requirements.txt file for the missing module.
474 2

热门文章

最新文章