GCC 15.1 : print fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello
  I'm using MinGW installed on Windows 10 Pro via MSYS2.
g++ --version returns: 'g++.exe (Rev5, Built by MSYS2 project) 15.1.0'
gdb --version returns: 'GNU gdb (GDB) 16.3'
I'm learning C++23, and when I write:
#include <iostream>
#include <print>
int main() {
    std::print("Hello, World!\n");
    return 0;
}
In Code::Blocks 25.3, when I start the compilation I obtain:
g++.exe -Wall -fexceptions -g -std=c++23  -c "C:\Users\rolla\Documents\Formation\C++\Projets\C++ moderne\testPrint\main.cpp" -o obj\Debug\main.o
g++.exe  -o bin\Debug\testPrint.exe obj\Debug\main.o  -O1
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: obj\Debug\main.o: in function `std::vprint_unicode(_iobuf*, std::basic_string_view<char, std::char_traits<char> >, std::basic_format_args<std::basic_format_context<std::__format::_Sink_iter<char>, char> >)':
I get the following error:
C:/msys64/ucrt64/include/c++/15.1.0/print:81:(.text$_ZSt14vprint_unicodeP6_iobufSt17basic_string_viewIcSt11char_traitsIcEESt17basic_format_argsISt20basic_format_contextINSt8__format10_Sink_iterIcEEcEE[_ZSt14vprint_unicodeP6_iobufSt17basic_string_viewIcSt11char_traitsIcEESt17basic_format_argsISt20basic_format_contextINSt8__format10_Sink_iterIcEEcEE]+0x1a1): undefined reference to `std::__open_terminal(_iobuf*)'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/ucrt64/include/c++/15.1.0/print:87:(.text$_ZSt14vprint_unicodeP6_iobufSt17basic_string_viewIcSt11char_traitsIcEESt17basic_format_argsISt20basic_format_contextINSt8__format10_Sink_iterIcEEcEE[_ZSt14vprint_unicodeP6_iobufSt17basic_string_viewIcSt11char_traitsIcEESt17basic_format_argsISt20basic_format_contextINSt8__format10_Sink_iterIcEEcEE]+0x257): undefined reference to `std::__write_to_terminal(void*, std::span<char, 18446744073709551615ull>)'
collect2.exe: error: ld returned 1 exit status
It seems there’s a missing link to internal symbols from the standard library (__open_terminal, __write_to_terminal).
What’s causing this issue, and is there an immediate solution?
Looking forward to your reply.
Best regards.

Luc
luc@xxxxxxxxxxxxxx




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux