https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123908

            Bug ID: 123908
           Summary: [mingw, 16 regression] Undefined reference to
                    std::__get_once_call()
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: manisandro at gmail dot com
  Target Milestone: ---

Possibly as a consequence of [1], the following

#include <mutex>
std::once_flag flag;

void f() {
}

int main() {
    std::call_once(flag, f);
}

fails to build with mingw-gcc 16.0.1 (snapshot 20260127) with undefined
reference to std::__get_once_call() (and std::__get_once_callable()).

Adding -static-libstdc++ fixes the build. 


[1]
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=7ad39bc909d1b425d0fa1803dc53cd741c10150f

Reply via email to