You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While attempting to compile the library into WebAssembly (WASM), I found that the generated protoc.js cannot generate CPP files. It reports an error indicating that the proto file cannot be found. I used emsdk for the compilation.
The compilation process is as follows:
emcmake cmake -S protobuf-30.1/ -B build/ -DCMAKE_BUILD_TYPE=Release -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/home/username/WASM/protobuf-30.1 -DCMAKE_TOOLCHAIN_FILE=$(dirname $(which emcc))/cmake/Modules/Platform/Emscripten.cmake
cd build && emmake make -j 12
When I try to use node protoc.js --cpp_out=. message.proto in the compilation directory, the following error occurs:
username@UserPC:~/Source/protobuf/build$ node protoc.js --cpp_out=. message.proto
Could not make proto path relative: message.proto: No such file or directory
username@UserPC:~/Source/protobuf/build$ node -v
v21.7.3
I have tried this on both Ubuntu 22.04 and MacOS 13.6, and the results are consistent.
The text was updated successfully, but these errors were encountered:
Hello,
While attempting to compile the library into WebAssembly (WASM), I found that the generated
protoc.js
cannot generate CPP files. It reports an error indicating that the proto file cannot be found. I usedemsdk
for the compilation.The compilation process is as follows:
My
.proto
file content:When I try to use
node protoc.js --cpp_out=. message.proto
in the compilation directory, the following error occurs:I have tried this on both Ubuntu 22.04 and MacOS 13.6, and the results are consistent.
The text was updated successfully, but these errors were encountered: