Skip to content

Symbol redefinition on latest mingw gcc #133

Closed

Description

@guusw

Using msys2, updating to the latest gcc-mingw(x64), stacktrace doesn't seem to build anymore, the UUIDs of IDebugClient, etc. seem to be already defined in dbgeng.h

D:/a/shards/shards/build/_deps/boost-src/libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp:31:5: error: redefinition of 'struct __mingw_uuidof_s<IDebugClient>'
   31 |     __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
      |     ^~~~~~~~~~~~~~~
C:/msys64/mingw64/include/dbgeng.h:262:1: note: previous definition of 'struct __mingw_uuidof_s<IDebugClient>'
  262 | __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
      | ^~~~~~~~~~~~~~~
D:/a/shards/shards/build/_deps/boost-src/libs/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp:31:5: error: redefinition of 'constexpr const GUID& __mingw_uuidof() [with T = IDebugClient; GUID = GUID]'
   31 |     __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
      |     ^~~~~~~~~~~~~~~
C:/msys64/mingw64/include/dbgeng.h:262:1: note: 'constexpr const GUID& __mingw_uuidof() [with T = IDebugClient; GUID = GUID]' previously declared here
  262 | __CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
      | ^~~~~~~~~~~~~~~
> gcc --version
gcc.exe (Rev10, Built by MSYS2 project) 12.2.0
> uname -a
MSYS_NT-10.0-22000 Fragcolor-Eim 3.4.5.x86_64 2023-01-20 09:17 UTC x86_64 Msys

Activity

  1. yh-sb commented on May 20, 2023

    @yh-sb
    Contributor

    Bump from me.

    Same build issue with MinGW-w64 GCC 13.1 gcc.exe (MinGW-W64 x86_64-ucrt-mcf-seh, built by Brecht Sanders) 13.1.0 from here: https://winlibs.com/

  2. petrutlucian94 commented on Aug 18, 2023

    @petrutlucian94

    Those definitions were recently added to the mingw dbgeng.h header, causing the redefinition error: mirror/mingw-w64@ce5a9f6

  3. yh-sb commented on Aug 21, 2023

    @yh-sb
    Contributor

    Pull request to fix this issue: #140

  4. added a commit that references this issue on Sep 2, 2023
  5. valydumitru01 commented on Oct 11, 2023

    @valydumitru01

    Not only I get this error, but also I get another error when I try to use default stack traces (boost_stacktrace_basic) the memory addresses are undecodable. If you try to use addr2line you get ?? all the time. Making printing stack traces an impossible task for MinGW.
    My solution was downgrading to MinGW 7.5.

  6. valydumitru01 commented on Oct 11, 2023

    @valydumitru01

    Also it did not work using backtrace either.

  7. apolukhin commented on Feb 19, 2024

    @apolukhin
    Member

    Fixed in #140

    If the fix does not help, please create a PR with a nee fix (I have no ready-to-use environments with the required version of MinGW, so it's quite complocated to find the right fix)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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