Skip to content

Compiling with emscripten #128

@abeimler

Description

@abeimler

Hi,

I am experiencing a compiler error when using emscripten (compiling to wasm) since the latest update.

In file included from libs/fixed_containers/include/fixed_containers/fixed_circular_deque.hpp:4:
In file included from libs/fixed_containers/include/fixed_containers/fixed_deque.hpp:14:
libs/fixed_containers/include/fixed_containers/random_access_iterator.hpp:171:37: error: no member named 'iterator_' in 'RandomAccessIterator<ConstEntryProvider, MutableEntryProvider, CONSTNESS, DIRECTION>'
  171 |         return Self(std::next(other.iterator_, n));
      |                               ~~~~~ ^
1 error generated.

Looking into RandomAccessIterator<ConstEntryProvider, MutableEntryProvider, CONSTNESS, DIRECTION>, it appears that iterator_ is not a member. This raises the question of why it compiles successfully with gcc.

Notes:

  • Compiler: emcc/emc++ 3.1.61 emsdk up-to-date from git
  • Compiler: gcc 14.1.1 (compiles successfully)
  • CMake: 3.28.1
  • OS: Arch Linux (Kernel: 6.9.5)
/bin/ccache /usr/lib/emscripten/em++ -isystem vcpkg_installed/wasm32-emscripten/include ... -Os -DNDEBUG -std=c++20 -fcolor-diagnostics -fcolor-diagnostics -Wall ... -MD -MT ...

some warnings and include paths, but nothing special

I has not set up or cross-compiled the fixed-containers project itself with emcc; this issue arises in my other projects that build with emcc. The compilation works fine with gcc, but not for the web build.

This issue occurs with a personal fork of fixed-containers, which is up-to-date with the current main branch.

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