Closed fouvy closed 3 years ago
After I remove extern "C" { // C -> JS } from src/index.cpp This error is fixed.
There is another error:
&serial_bridge::encrypt_payment_id
member doesn't exist!
So, I remove
emscripten::function("encrypt_payment_id", &serial_bridge::encrypt_payment_id);
from src/index.cpp
Then, There is another error:
mymonero-core-js/src/emscr_async_send_bridge.cpp:386:50: error: no member named 'fee_mask' in 'monero_send_routine::LightwalletAPI_Res_GetUnspentOuts'
After I remove those three lines about fee_mask from emscr_async_send_bridge.cpp file, I build the whole project ok now.
line 386:
//ptrTo_taskAsyncContext->fee_mask = *(parsed_res.fee_mask);
line 411:
//ptrTo_taskAsyncContext->fee_mask,
line 501:
//ptrTo_taskAsyncContext->fee_mask,
I think fee_mask is not available now.
Something seems quite wrong with your setup somehow. Are you sure your submodules are all up-to-date? Did you run bin/update_submodules?
I have runned bin/update_submodules.
Did you ever resolve this?
I have resolve this problem.
What was the issue?
It's about build problem. Some code doesn't impl.
./bin/build-emcpp.sh -- EMCC_LINKER_FLAGSWASM -Wall -std=c++11 --bind -s MODULARIZE=1 -s 'EXPORT_NAME="MyMoneroCoreCpp"' --llvm-lto 1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ASSERTIONS=2 -s EXIT_RUNTIME=0 -s "BINARYEN_TRAP_MODE='clamp'" -s PRECISE_F32=1 -s DISABLE_EXCEPTION_CATCHING=0 -s EXCEPTION_DEBUG=1 -s DEMANGLE_SUPPORT=1 -s NO_DYNAMIC_EXECUTION=1 -s NODEJS_CATCH_EXIT=0 -s EXTRA_EXPORTED_RUNTIME_METHODS='["UTF8ToString"]' -s WASM=1 -Oz -s "BINARYEN_METHOD='native-wasm'" -s ALLOW_MEMORY_GROWTH=1 --post-js /home/user/GIT/mymonero-core-js/src/module-post.js -- EMCC_LINKER_FLAGSASMJS -Wall -std=c++11 --bind -s MODULARIZE=1 -s 'EXPORT_NAME="MyMoneroCoreCpp"' --llvm-lto 1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s ASSERTIONS=2 -s EXIT_RUNTIME=0 -s "BINARYEN_TRAP_MODE='clamp'" -s PRECISE_F32=1 -s DISABLE_EXCEPTION_CATCHING=0 -s EXCEPTION_DEBUG=1 -s DEMANGLE_SUPPORT=1 -s NO_DYNAMIC_EXECUTION=1 -s NODEJS_CATCH_EXIT=0 -s EXTRA_EXPORTED_RUNTIME_METHODS='["UTF8ToString"]' -s WASM=0 -Os --separate-asm -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s "BINARYEN_METHOD='asmjs'" -s ALLOW_MEMORY_GROWTH=0 --memory-init-file 0 -- Configuring done -- Generating done -- Build files have been written to: /home/user/GIT/mymonero-core-js/build
emmake is a helper for make, setting various environment variables so that emcc etc. are used. Typical usage:
(but you can run any command instead of make)
Scanning dependencies of target MyMoneroCoreCpp_WASM [ 0%] Building CXX object CMakeFiles/MyMoneroCoreCpp_WASM.dir/src/index.cpp.o In file included from /home/user/GIT/mymonero-core-js/src/index.cpp:33: /home/user/GIT/emsdk/emscripten/1.38.13/system/include/emscripten/bind.h:11:2: error: Including <emscripten/bind.h> requires building with -std=c++11 or newer!
error Including <emscripten/bind.h> requires building with -std=c++11 or newer!
^ In file included from /home/user/GIT/mymonero-core-js/src/index.cpp:35: In file included from /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/src/serial_bridge_index.hpp:37: /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/cryptonote_config.h:204:8: error: ISO C++ forbids forward references to 'enum' types enum network_type : uint8_t ^ /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/cryptonote_config.h:204:21: error: expected unqualified-id enum network_type : uint8_t ^ /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/cryptonote_config.h:224:50: error: variable has incomplete type 'cryptonote::network_type' inline const config_t& get_config(network_type nettype) ^ /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/cryptonote_config.h:204:8: note: forward declaration of 'cryptonote::network_type' enum network_type : uint8_t ^ In file included from /home/user/GIT/mymonero-core-js/src/index.cpp:36: In file included from /home/user/GIT/mymonero-core-js/src/emscr_async_send_bridge.hpp:39: In file included from /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/src/monero_send_routine.hpp:38: In file included from /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/string_tools.h:47: In file included from /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/hex.h:36: In file included from /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/wipeable_string.h:35: /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/memwipe.h:54:18: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using type = T; ^ /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/memwipe.h:77:24: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using scrubbed_arr = scrubbed<std::array<T, N>>; ^ /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/memwipe.h:77:50: error: expected expression using scrubbed_arr = scrubbed<std::array<T, N>>; ^ /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/memwipe.h:77:50: error: expected a type In file included from /home/user/GIT/mymonero-core-js/src/index.cpp:36: In file included from /home/user/GIT/mymonero-core-js/src/emscr_async_send_bridge.hpp:39: In file included from /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/src/monero_send_routine.hpp:38: In file included from /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/string_tools.h:47: In file included from /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/hex.h:36: /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/wipeable_string.h:47:37: warning: rvalue references are a C++11 extension [-Wc++11-extensions] wipeable_string(wipeable_string &&other); ^ /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/wipeable_string.h:49:33: warning: rvalue references are a C++11 extension [-Wc++11-extensions] wipeable_string(std::string &&other); ^ /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/wipeable_string.h:61:29: error: expected ';' at end of declaration list const char data() const noexcept { return buffer.data(); } ^ ; /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/wipeable_string.h:74:56: error: expected ';' at end of declaration list bool operator==(const wipeable_string &other) const noexcept { return buffer == other.buffer; } ^ ; /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/wipeable_string.h:89:9: error: use of undeclared identifier 'size' if (size() != sizeof(T) 2) ^ /home/user/GIT/mymonero-core-js/src/submodules/mymonero-core-cpp/contrib/monero-core-custom/epee/include/wipeable_string.h:94:15: error: no member named 'size' in 'epee::wipeable_string' if (blob->size() != sizeof(T))