On Fri, Feb 10, 2023 at 12:13 AM Tibor Kovács <tiberiusfa...@gmail.com>
wrote:

> Hi Sam,
>
> Thanks for your reply. The Debug error message disappeared, big thanks for
> this!
>
> The ambiguous error message looks like this:
> The code section:
> Face *clone(const vertex_t *old_base, vertex_t *new_base, std::
> unordered_map<const edge_t *, edge_t *> &edge_map) const;
> This is from Carve.
> The full error message is this:
>
> In file included from
> /mnt/c/Works/Dev/wasm/3rdParty/Carve/src/convex_hull.cpp:22:
> In file included from
> /mnt/c/Works/Dev/wasm/3rdParty/Carve/include/carve/csg.hpp:28:
> /mnt/c/Works/Dev/wasm/3rdParty/Carve/include/carve/mesh.hpp:412:70: error:
> reference to 'unordered_map' is ambiguous
>       Face *clone(const vertex_t *old_base, vertex_t *new_base,
> std::unordered_map<const edge_t *, edge_t *> &edge_map) const;
>                                                                      ^
> /mnt/c/Works/Dev/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/unordered_map:1028:28:
> note: candidate found by name lookup is 'std::__2::unordered_map'
> class _LIBCPP_TEMPLATE_VIS unordered_map
>                            ^
> /mnt/c/Works/Dev/wasm/3rdParty/Carve/include/carve/collection/unordered/fallback_impl.hpp:26:9:
> note: candidate found by name lookup is 'std::unordered_map'
>   class unordered_map : public std::map<K, T> {
>
        ^
>
>
Looks like some kind of configuration issue where you are including both
C++'s `std::unordered_map` as well as some kind of pollyfil for it
fallback_impl.hpp.  When they are both included they (unsurprisingly)
colide with each other.

Is `fallback_impl.hpp` being included in my mistake?  Was it included in
previous builds where this was working (try going back to your working
configuration and adding a #error to `fallback_impl.hpp`)?

I imagine some kind of change to libc++ could have triggered this but there
is probably some local change to your project that will fix it.


'Sam Clegg' via emscripten-discuss <emscripten-discuss@googlegroups.com>
> ezt írta (időpont: 2023. febr. 9., Cs, 18:31):
>
>>
>>
>> On Thu, Feb 9, 2023 at 7:27 AM Tibor Kovács <tiberiusfa...@gmail.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> I have several problems with the 3.1.31 compiler. I made a CMake for a
>>> project and with the 3.1.13 it compiled properly. Now I updated to 3.1.31
>>> and it doesn't work anymore. I try to compile it in Debug mode with the
>>> next DEBUG definitions (this is a static library):
>>>
>>> set(DEBUG_DEFINITIONS
>>>     _LIBCPP_DEBUG=1
>>>     _DEBUG
>>>     CMAKE_BUILD
>>> )
>>>
>>> and the DEBUG_DEFINITIONS are added like this:
>>>
>>> target_compile_definitions(${LIBRARY_NAME}
>>>     PRIVATE
>>>         "$<$<CONFIG:DEBUG>:${DEBUG_DEFINITIONS}>"
>>> )
>>>
>>> Previously it worked but now I have this error message:
>>>
>>> /mnt/c/Works/Dev/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__debug:24:5:
>>> error: "Enabling the debug mode now requires having configured the library
>>> with support for the debug mode"
>>> # error "Enabling the debug mode now requires having configured the
>>> library with support for the debug mode"
>>>     ^
>>> 1 error generated.
>>>
>>
>> That looks like libc++ is warning you that you are using a legacy macro:
>>
>>  // Catch invalid uses of the legacy _LIBCPP_DEBUG toggle.
>>
>> #if defined(_LIBCPP_DEBUG) && _LIBCPP_DEBUG != 0 &&
>> !defined(_LIBCPP_ENABLE_DEBUG_MODE)
>> #   error "Enabling the debug mode now requires having configured the
>> library with support for the debug mode"
>> #endif
>>
>> It looks like you are expected to define _LIBCPP_ENABLE_DEBUG_MODE.   I'm
>> not sure what either of those macros do, but they are not specific to
>> emscripten, and apply to libc++ in general.
>>
>>>
>>>
>>>
>>> It doesn't stop here. If I compile it in Release mode, I'll have this
>>> error messages: error: reference to 'unordered_map' is ambiguous. AFAIK
>>> this error message would be generated if the compiler doesn't know the C++
>>> version. But I specified it like this:
>>>
>>> target_compile_options(${LIBRARY_NAME}
>>>     PRIVATE
>>>         -std=c++2a
>>>         -fwasm-exceptions
>>>         -pthread
>>> )
>>>
>>> What could be the solution for these errors?
>>> Thank you in advance the helps.
>>>
>>>
>> Can you share the full error message?  And even better a piece of sample
>> code that generates it?   I imagine this is another generic libc++ issue
>> and not emscripten-specific.
>>
>> cheers,
>> sam
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "emscripten-discuss" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/emscripten-discuss/JAjo2Y3N1UQ/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> emscripten-discuss+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/emscripten-discuss/CAL_va29CMBO65yvAo_XZSyS4pNWv-x%2B%3DFFWdCfVB_Ryasg4iQA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/emscripten-discuss/CAL_va29CMBO65yvAo_XZSyS4pNWv-x%2B%3DFFWdCfVB_Ryasg4iQA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to emscripten-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/CAJTUF4-jVKSnNXExYq8xW-pLSbRrufZWEMKnFV5T7yN%3DWRpQPg%40mail.gmail.com
> <https://groups.google.com/d/msgid/emscripten-discuss/CAJTUF4-jVKSnNXExYq8xW-pLSbRrufZWEMKnFV5T7yN%3DWRpQPg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2-3%2Bc20buLeKMw90HDDbK1wC2yiVX_VJ5VYogOVnmhziQ%40mail.gmail.com.

Reply via email to