0

I wrote a code that is compiled into wasm with rust, which includes the pfx file added when reqwest requests, but it prompts openssl error when compiling. What is the reason please?

error: failed to run custom build command for `openssl-sys v0.9.77`

Caused by:

  ...

  --- stderr
  In file included from apps/app_rand.c:10:
  In file included from apps/apps.h:13:
  In file included from ./e_os.h:16:
  In file included from include/openssl/e_os2.h:243:
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.1.6/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found
  #include_next <inttypes.h>
                ^~~~~~~~~~~~
  apps/bf_prefix.c:10:10: fatal error: 'stdio.h' file not found
  #include <stdio.h>
           ^~~~~~~~~
  In file included from apps/opt.c:9:
  In file included from apps/apps.h:13:
  In file included from ./e_os.h:16:
  In file included from include/openssl/e_os2.h:243:
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.1.6/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found
  #include_next <inttypes.h>
                ^~~~~~~~~~~~
  error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
  apps/s_socket.c:11:10: fatal error: 'stdio.h' file not found
  #include <stdio.h>
           ^~~~~~~~~
  1 error generated.
  error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
  1 error generated.
  apps/s_cb.c:11:10: fatal error: 'stdio.h' file not found
  #include <stdio.h>
           ^~~~~~~~~
  make[1]: *** [crypto/aes/aes_cfb.o] Error 1
  make[1]: *** Waiting for unfinished jobs....
  make[1]: *** [crypto/aes/aes_cbc.o] Error 1
  apps/apps.c:18:10: fatal error: 'stdio.h' file not found
  #include <stdio.h>
           ^~~~~~~~~
  1 error generated.
  1 error generated.
  make[1]: *** [apps/app_rand.o] Error 1
  make[1]: *** [apps/bf_prefix.o] Error 1
  1 error generated.
  make[1]: *** [apps/opt.o] Error 1
  1 error generated.
  make[1]: *** [apps/s_socket.o] Error 1
  1 error generated.
  make[1]: *** [apps/s_cb.o] Error 1
  1 error generated.
  make[1]: *** [apps/apps.o] Error 1
  make: *** [build_libs] Error 2
  thread 'main' panicked at '


  Error building OpenSSL:
      Command: "make" "build_libs"
      Exit status: exit status: 2

What file is inttypes.h and how can I change it so that it can be found ?

xujizhong
  • 42
  • 3

1 Answers1

0

It looks like you have some incorrect include paths in your build.

The headers that live in /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain are almost certainly not going to be compatible with a WebAssembly toolchain such as emscripten or wasi-sdk. I would advice you to find out where they are getting injected and remove them. It seems like you the software you are building might be need more configuration to know that you are trying to cross compile to wasm.

sbc100
  • 2,619
  • 14
  • 11