Skip to content

Type conflict with mp_digit and mp_int when building against Tcl with bundled libtommath #57

Description

@Sublime1

Hello!

thank you for this wonderful library. I recent upgraded from 0.15.3 to 0.15.7 and ran into some problems. I'm building a Docker container that runs Naviserver. I got my LLM to help write up this issue - hope that's OK to do.

When building RL_JSON against a Tcl installation that exposes its own copy of libtommath (e.g., via tcl.h), the build fails due to conflicting type definitions for mp_digit and mp_int. RL_JSON vendors its own copy of libtommath, while Tcl also exposes these types, but with potentially different definitions.

Error output

local/include/tommath.h:59:18: error: conflicting types for 'mp_digit'; have 'uint64_t' {aka 'long unsigned int'}
/usr/local/ns/include/tcl.h:2258:22: note: previous declaration of 'mp_digit' with type 'mp_digit' {aka 'unsigned int'}
local/include/tommath.h:179:3: error: conflicting types for 'mp_int'; have 'struct '
/usr/local/ns/include/tcl.h:2256:23: note: previous declaration of 'mp_int' with type 'mp_int'

Environment

Ubuntu 24.04.2 LTS Docker container running on WSL on Windows 11
Tcl version: 8.6.17
RL_JSON version: 0.15.7

Activity

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