8000 Compiler error in generated WASM/Protobuf · Issue #138 · Snapchat/djinni · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Compiler error in generated WASM/Protobuf #138
Open
@guthriec

Description

@guthriec

Hi,

I have an interface that includes some protobuf types (e.g.

my_service = interface + c {
  get_my_proto_type(arg: i64): ProtoType;
}

Generating for WASM works fine, using a command like:

../../../djinni/src/run \
    --java-out java \
    --wasm-out wasm \
    --wasm-include-cpp-prefix ../cpp/ \
    --wasm-base-lib-include-prefix ../../../../djinni/support-lib/wasm/ \
    --ts-out ts \
    --ts-module core \
...

However, the generated code runs into compilation errors when I try to compile using Emscripten:
emcc -o test.html wasm/my_service.cpp -I../../my_dependency
yielding an error:

wasm/my_service.cpp:27:26: error: use of class template '::djinni::Protobuf' requires template arguments
        return ::djinni::Protobuf::fromCpp(r);
                         ^
wasm/../../../../djinni/support-lib/wasm/djinni_wasm.hpp:272:7: note: template is declared here
class Protobuf {
      ^
wasm/concern_service.cpp:30:60: error: use of class template '::djinni::Protobuf' requires template arguments
        return ::djinni::ExceptionHandlingTraits<::djinni::Protobuf>::handleNativeException(e);
                                                           ^
wasm/../../../../djinni/support-lib/wasm/djinni_wasm.hpp:272:7: note: template is declared here
class Protobuf {

I notice I did not set --wasm-include-prefix, nor do I really understand what it means -- am I missing something there? Or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0