Emscripten编译Python错误: 链接名为’hypot’的全局变量: 符号多次定义

huangapple go评论81阅读模式
英文:

Emscripten compiling Python error: Linking globals named 'hypot': symbol multiply defined

问题

在链接阶段出现错误:error: Linking globals named 'hypot': symbol multiply defined!,似乎是在说全局函数 hypot 存在多个定义。我已在 pymath.c 中查找过 grep,只找到一个定义。我该如何解决这个问题?

英文:

I am trying to build Python with emscripten and link it to my main program, but during the linking stage im getting:

error: Linking globals named 'hypot': symbol multiply defined!

which seems to be saying that there are multiple definitions of the global function hypot, I have grepped hypot and only found one definition in pymath.c.

How do i fix this problem?

答案1

得分: 0

问题是emscripten在通过emsdk提供C标准库时定义了hypot。所以解决方案是进入pyconfig.h并#define HAVE_HYPOT 1

英文:

The problem was emscripten was defining hypot when it provides the C standard library through emsdk. So the solution is to go into pyconfig.h and to #define HAVE_HYPOT 1.

huangapple
  • 本文由 发表于 2023年6月27日 20:10:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76564724.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定