解决 wasm-ld: error: initial memory too small, 18319040 bytes needed

使用emscripten编码ffmpeg,编译报错

wasm-ld: error: initial memory too small, 18319040 bytes needed
emcc: error: '/home/ctx/emsdk/upstream/bin/wasm-ld -o /tmp/emscripten_temp_tjga3v5e/ffmpeg_g.wasm -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -L/home/ctx/emsdk/upstream/emscripten/system/local/lib -Llibavresample -L/home/ctx/emsdk/upstream/emscripten/system/lib -Llibavutil -L/home/ctx/emsdk/upstream/emscripten/cache/wasm -Llibpostproc -Llibswscale -Llibswresample -z noexecstack fftools/ffmpeg_opt.o fftools/ffmpeg_filter.o fftools/ffmpeg_hw.o fftools/cmdutils.o fftools/ffmpeg.o libavdevice/libavdevice.a libavfilter/libavfilter.a libavformat/libavformat.a libavcodec/libavcodec.a libswresample/libswresample.a libswscale/libswscale.a libavutil/libavutil.a /home/ctx/emsdk/upstream/emscripten/cache/wasm/libc.a /home/ctx/emsdk/upstream/emscripten/cache/wasm/libcompiler_rt.a /home/ctx/emsdk/upstream/emscripten/cache/wasm/libc++-noexcept.a /home/ctx/emsdk/upstream/emscripten/cache/wasm/libc++abi-noexcept.a /home/ctx/emsdk/upstream/emscripten/cache/wasm/libdlmalloc.a /home/ctx/emsdk/upstream/emscripten/cache/wasm/libpthread_stub.a /home/ctx/emsdk/upstream/emscripten/cache/wasm/libc_rt_wasm.a /home/ctx/emsdk/upstream/emscripten/cache/wasm/libsockets.a -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --allow-undefined --import-memory --import-table --strip-debug --export main --export malloc --export free --export stackSave --export stackRestore --export stackAlloc --export __data_end --export __wasm_call_ctors --export fflush --export __errno_location --export _get_tzname --export _get_daylight --export _get_timezone --export memalign --export memset -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024' failed (1)
make: *** [ffmpeg_g] Error 1

修改emsdk/upstream/emscripten/src目录里面的settings.js(入下图),然后重新emconfigure,然后编译

参考:https://blog.csdn.net/weixin_42651102/article/details/107129579

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值