我自己添加了如下 set(qjs_cflags -Wall -fno-exceptions -s MEMORY64=1) 参数,编译通过了
但是将UE4.27打包到HTML5平台运行时有如下2种错误情况:
1、只能在启动脚本调用C++函数
// start.ts
const script1 = require("./script1")
script1.test1()
const platformName = UE.GameplayStatics.GetPlatformName()//在启动脚本调用C++函数OK
// script1.ts
const platformName = UE.GameplayStatics.GetPlatformName()//在非启动脚本调用C++函数就会报错
export function test1(){
const platformName1 = UE.GameplayStatics.GetPlatformName()//在函数内部,调用OK
}

2、不能引用第三个脚本
// start.ts
const script1 = require("./script1")//启动脚本引用另一个脚本是OK的
script1.test1(1, 4)
// script1.ts
const script2 = require("./script2")//不能引用任何第3个脚本
script2.test2(2, 3)
export function test1(a, b){
return a + b
}
// script2.ts
export function test2(a, b){
return a - b
}

希望帮忙分析一下问题缘由,指点一下该如何修改,谢谢
补充一下:
1、在虚幻编辑器下Windows平台,不会出现这2个问题,运行都正常
2、使用wasm32编译的quickjs库,打包之后在HTML5运行也正常
我自己添加了如下
set(qjs_cflags -Wall -fno-exceptions -s MEMORY64=1)参数,编译通过了但是将UE4.27打包到HTML5平台运行时有如下2种错误情况:
1、只能在启动脚本调用C++函数
2、不能引用第三个脚本
希望帮忙分析一下问题缘由,指点一下该如何修改,谢谢
补充一下:
1、在虚幻编辑器下Windows平台,不会出现这2个问题,运行都正常
2、使用wasm32编译的quickjs库,打包之后在HTML5运行也正常