V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
lxiian
V2EX  ›  程序员

macos 26 m 芯片编译 telegram android 项目在 ndk 阶段会报错

  •  
  •   lxiian · 1 天前 via iPhone · 1011 次点击

    有人用 macbook apple silicon 编译过 telegram 安卓项目吗?

    我用 windows 机器能正常编译,用 m 芯片的 macos 在编译 c/c++代码的时候会直接报错。

    libc++abi: Terminating due to typed operator new being invoked before its static initializer…
    likely happening in code with -ftyped-cxx-new-delete enabled and statically linking against libc++abi.try disabling TMO with -fno-typed-cxx-new-delete 。
    

    我问了 ai ,说是 ndk 21 版本在 m 芯片有兼容性问题,按照给的解决方案在 cmakelists 里加上对应的编译参数,没效果。 如果直接升级 ndk 版本,会报一堆其他新的错误。

    我对 ndk 方面不太了解。有大佬遇到过这个问题吗?

    3 条回复    2025-12-13 12:32:24 +08:00
    seers
        1
    seers  
       1 天前 via Android
    native 编译有时候 toolchain 差个版本号都失败,更别提跨架构了
    ZeoKarl
        2
    ZeoKarl  
       1 天前
    要不你试试启动 x86 的 shell.
    启动的命令是 arch -x86_64 zsh
    mumu666
        3
    mumu666  
       1 天前 via Android
    编译过,但是也是 ai 给解决的,忘记 ai 咋该的了
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   905 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:19 · PVG 07:19 · LAX 15:19 · JFK 18:19
    ♥ Do have faith in what you're doing.