Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emcc error: member reference base type 'void' is not a structure or union #349

Closed
sonygod opened this issue Dec 13, 2022 · 1 comment
Closed

Comments

@sonygod
Copy link

sonygod commented Dec 13, 2022

build a simple code and got these error?

emcc src/Wasm_Clipper2.cpp -Iinclude -Llib -lClipper2emcc -o bin/clipper2tools.js -s EXPORTED_FUNCTIONS='["_malloc","_free","_create_offset_line"]' -s EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' -s MALLOC=emmalloc -w -sALLOW_MEMORY_GROWTH -g3

platform:emscripten

include\clipper2/clipper.engine.h:307:53: error: member reference base type 'void' is not a structure or union
                        auto* result = childs_.emplace_back(std::move(p)).get();
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
include\clipper2/clipper.engine.h:386:58: error: member reference base type 'void' is not a structure or union
                        PolyPathD* result = childs_.emplace_back(std::move(p)).get();
@reunanen
Copy link
Contributor

You need to have C++17 supported for emplace_back to return a value (reference).

You may find this helpful: emscripten-core/emscripten#5513

Alternatively, you should be able to relatively easily do something like this instead:

    childs_.emplace_back(std::move(p));
    auto* result = childs_.back().get();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants