ld unable to find iostreams functions under MSYS2

#include <Windows.h>
#include <iostream>
using namespace std;

int APIENTRY wWinMain(
	_In_	 HINSTANCE	hInstance,
	_In_opt_ HINSTANCE	hPrevInstance,
	_In_	 LPWSTR		lpCmdLine,
	_In_ 	 int		nCmdShow
) {
    return EXIT_SUCCESS;
}
cmake_minimum_required(VERSION 3.10.2)
project(cmaketest VERSION 0.0.1)

set(CMAKE_MODULE_PATH "cmake")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++2a -municode")

add_executable(cmaketest cmaketest.cc)
target_include_directories(cmaketest PUBLIC "${PROJECT_BINARY_DIR}")
target_link_libraries(cmaketest)
$ ninja
[2/2] Linking CXX executable cmaketest
FAILED: cmaketest
: && /mingw64/bin/CC.exe -std=gnu++2a -municode  CMakeFiles/cmaketest.dir/cmaketest.cc.obj -o cmaketest   && :
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/cmaketest.dir/cmaketest.cc.obj:cmaketest.cc:(.text+0x2b): undefined reference to `std::ios_base::Init::~Init()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/cmaketest.dir/cmaketest.cc.obj:cmaketest.cc:(.text+0x5b): undefined reference to `std::ios_base::Init::Init()'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.