Skip to content

fix build with fmt >= 11 - #327

Merged
koide3 merged 1 commit into
koide3:masterfrom
aleph-ra:fix/fmt-ptr-shared-ptr
Oct 8, 2026
Merged

koide3 merged 1 commit into
koide3:masterfrom
aleph-ra:fix/fmt-ptr-shared-ptr

Conversation

@aleph-ra

Copy link
Copy Markdown
Contributor

Closes #326 .

src/glim/odometry/odometry_estimation_ct.cpp:130 passes std::shared_ptr directly to fmt::ptr(). fmt 11 removed the std::shared_ptr and std::unique_ptr overloads of fmt::ptr, so the call now selects the generic ptr(T) template and trips its is_pointer static assert:

error: static assertion failed: fmt::ptr used with non-pointer
error: no matching function for call to 'bit_cast<const void*>(std::shared_ptr<glim::EstimationFrame>&)'

This affects anyone building outside the Ubuntu apt versions, which in my case is a conda/pixi environment, where conda-forge currently ships fmt 12.1.0.

The small change is completely version agnostic and works on previous versions of fmt identically.

The library builds completely with this single line changed, so it appears to be the only fmt >= 11 incompatibility reachable in that configuration.

@dddd-jh

dddd-jh commented Oct 6, 2026

Copy link
Copy Markdown

Checked the pointer-formatting change in a standalone C++17 build on Windows with official fmt headers:

fmt version Original fmt::ptr(shared_ptr) Patched fmt::ptr(shared_ptr.get())
8.1.1 Compiles and runs Compiles and runs
11.2.0 Fails the pointer-type static assertion Compiles and runs
12.1.0 Fails the pointer-type static assertion Compiles and runs

With the patch, the formatted log message matches formatting the corresponding const void* values, including an empty shared_ptr. This checks the affected call pattern with fmt in header-only mode; it is not a complete GLIM/spdlog build or a reproduction of the full Linux/pixi environment in #326.

@themightyoarfish

Copy link
Copy Markdown
Contributor

related fmt issue on macos: #302

maybe they can be fixed together.

@koide3

koide3 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Thanks! I'm merging this PR.

@koide3
koide3 merged commit 1a197c9 into koide3:master Oct 8, 2026
5 of 6 checks passed
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

Successfully merging this pull request may close these issues.

Build fails with fmt >= 11 (odometry_estimation_ct.cpp:130)

5 participants