kripken / gmp.js

A port of the GNU Multiple-Precision Library (GMP), a library for arbitrary precision arithmetic, to JavaScript using Emscripten
GNU General Public License v3.0
44 stars 12 forks source link

Compiling gives unresolved symbols #5

Closed Flarp closed 7 years ago

Flarp commented 7 years ago

I followed the tutorial for compiling this step by step, and on the final step (running emscripten.sh), I got this output

bitcode ==> javascript
warning: unresolved symbol: __gmpz_cmp
warning: unresolved symbol: __gmpz_mul_ui
warning: unresolved symbol: __gmpz_submul_ui
warning: unresolved symbol: __gmpz_init_set_ui
warning: unresolved symbol: __gmpz_mul_2exp
warning: unresolved symbol: __gmpz_init
warning: unresolved symbol: __gmpz_fdiv_qr
warning: unresolved symbol: __gmpz_add

And running the complete.js gives me this

missing function: __gmpz_init
-1
-1

/home/ubuntu/workspace/gmp.js/complete.js:117
      throw ex;
      ^
abort(-1) at Error
    at jsStackTrace (/home/ubuntu/workspace/gmp.js/complete.js:1045:13)
    at stackTrace (/home/ubuntu/workspace/gmp.js/complete.js:1062:22)
    at abort (/home/ubuntu/workspace/gmp.js/complete.js:6743:44)
    at ___gmpz_init (/home/ubuntu/workspace/gmp.js/complete.js:1744:56)
    at Object._main (/home/ubuntu/workspace/gmp.js/complete.js:4978:2)
    at Object.callMain (/home/ubuntu/workspace/gmp.js/complete.js:6627:30)
    at doRun (/home/ubuntu/workspace/gmp.js/complete.js:6681:60)
    at run (/home/ubuntu/workspace/gmp.js/complete.js:6695:5)
    at Object.<anonymous> (/home/ubuntu/workspace/gmp.js/complete.js:6769:1)
    at Module._compile (module.js:541:32)
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.

How do I fix this?

Flarp commented 7 years ago

Turns out it needs to be done on a 32 bit system. It will not work on a 64 bit system.