Stuck with getting cmdstanr to work (Win 10)

This happens when I rebuild Part 3

g++ -Wno-nonnull -D_UCRT -Wno-deprecated-declarations -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I stan/lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.4.0 -I stan/lib/stan_math/lib/boost_1.78.0 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS               -Wl,-L,"C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb"        bin/cmdstan/print.o  -static-libgcc -static-libstdc++     -Wl,-L,"C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb"     -o bin/print.exe
g++ -Wno-nonnull -D_UCRT -Wno-deprecated-declarations -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I stan/lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.4.0 -I stan/lib/stan_math/lib/boost_1.78.0 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials  -D_USE_MATH_DEFINES  -DBOOST_DISABLE_ASSERTS               -Wl,-L,"C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb"        bin/cmdstan/diagnose.o  -static-libgcc -static-libstdc++     -Wl,-L,"C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb"     -o bin/diagnose.exe
touch stan/lib/stan_math/lib/tbb/version_tbb_2020.3
tbb_root="../tbb_2020.3" CXX="g++" CC="gcc" LDFLAGS='-Wl,-L,"C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb"  ' 'mingw32-make.exe' -C "stan/lib/stan_math/lib/tbb" -r -f "C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbb" compiler=gcc cfg=release stdver=c++1y  CXXFLAGS="-D_UCRT"
mingw32-make[1]: Entering directory 'C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb'
C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbb:28: CONFIG: cfg=release arch=intel64 compiler=gcc target=windows runtime=mingw13.2.0
g++ -o concurrent_hash_map.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/concurrent_hash_map.cpp
g++ -o concurrent_queue.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/concurrent_queue.cpp
In file included from ../tbb_2020.3/src/tbb/concurrent_hash_map.cpp:17:
../tbb_2020.3/include/tbb/concurrent_hash_map.h: In constructor 'tbb::interface5::internal::hash_map_base::hash_map_base()':
../tbb_2020.3/include/tbb/concurrent_hash_map.h:131:24: warning: 'void* memset(void*, int, size_t)' clearing an object of type 'struct tbb::interface5::internal::hash_map_base::bucket' with no trivial copy-assignment; use value-initialization instead [-Wclass-memaccess]
  131 |             std::memset(my_embedded_segment, 0, sizeof(my_embedded_segment));
      |             ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tbb_2020.3/include/tbb/concurrent_hash_map.h:93:16: note: 'struct tbb::interface5::internal::hash_map_base::bucket' declared here
   93 |         struct bucket : tbb::internal::no_copy {
      |                ^~~~~~
g++ -o concurrent_vector.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/concurrent_vector.cpp
g++ -o dynamic_link.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/dynamic_link.cpp
g++ -o itt_notify.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/itt_notify.cpp
g++ -o cache_aligned_allocator.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/cache_aligned_allocator.cpp
../tbb_2020.3/src/tbb/dynamic_link.cpp: In function 'void tbb::internal::dynamic_unlink(dynamic_link_handle)':
../tbb_2020.3/src/tbb/dynamic_link.cpp:33:39: warning: value computed is not used [-Wunused-value]
   33 |     #define dlclose( handle )       ( ! FreeLibrary( handle ) )
      |                                     ~~^~~~~~~~~~~~~~~~~~~~~~~~~
../tbb_2020.3/src/tbb/dynamic_link.cpp:418:13: note: in expansion of macro 'dlclose'
  418 |             dlclose( handle );
      |             ^~~~~~~
g++ -o pipeline.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/pipeline.cpp
g++ -o queuing_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/queuing_mutex.cpp
g++ -o queuing_rw_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/queuing_rw_mutex.cpp
g++ -o reader_writer_lock.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/reader_writer_lock.cpp
g++ -o spin_rw_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/spin_rw_mutex.cpp
g++ -o x86_rtm_rw_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/x86_rtm_rw_mutex.cpp
g++ -o spin_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/spin_mutex.cpp
g++ -o critical_section.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/critical_section.cpp
g++ -o mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/mutex.cpp
g++ -o recursive_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/recursive_mutex.cpp
g++ -o condition_variable.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/condition_variable.cpp
g++ -o tbb_thread.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/tbb_thread.cpp
g++ -o concurrent_monitor.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/concurrent_monitor.cpp
g++ -o semaphore.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/semaphore.cpp
g++ -o private_server.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/private_server.cpp
g++ -o rml_tbb.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/rml/client/rml_tbb.cpp
g++ -o tbb_misc.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I. ../tbb_2020.3/src/tbb/tbb_misc.cpp
g++ -o tbb_misc_ex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/tbb_misc_ex.cpp
g++ -o task.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/task.cpp
g++ -o task_group_context.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/task_group_context.cpp
g++ -o governor.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/governor.cpp
g++ -o market.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/market.cpp
g++ -o arena.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/arena.cpp
g++ -o scheduler.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/scheduler.cpp
In file included from C:/rtools42/ucrt64/include/winnt.h:27,
                 from C:/rtools42/ucrt64/include/minwindef.h:163,
                 from C:/rtools42/ucrt64/include/windef.h:9,
                 from C:/rtools42/ucrt64/include/windows.h:69,
                 from ../tbb_2020.3/src/tbb/../rml/include/rml_base.h:25,
                 from ../tbb_2020.3/src/tbb/../rml/include/rml_tbb.h:23,
                 from ../tbb_2020.3/src/tbb/scheduler.h:25,
                 from ../tbb_2020.3/src/tbb/custom_scheduler.h:20,
                 from ../tbb_2020.3/src/tbb/scheduler.cpp:17:
In function 'long long unsigned int __readgsqword(long unsigned int)',
    inlined from '_TEB* NtCurrentTeb()' at C:/rtools42/ucrt64/include/winnt.h:10020:86,
    inlined from 'void tbb::internal::generic_scheduler::init_stack_info()' at ../tbb_2020.3/src/tbb/scheduler.cpp:169:42:
C:/rtools42/ucrt64/include/psdk_inc/intrin-impl.h:838:1: warning: array subscript 0 is outside array bounds of 'long long unsigned int [0]' [-Warray-bounds=]
  838 | __buildreadseg(__readgsqword, unsigned __int64, "gs", "q")
      | ^~~~~~~~~~~~~~
In member function 'void tbb::internal::generic_scheduler::init_stack_info()':
cc1plus.exe: note: source object is likely at address zero
g++ -o observer_proxy.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/observer_proxy.cpp
In function 'long long unsigned int __readgsqword(long unsigned int)',
    inlined from '_TEB* NtCurrentTeb()' at C:/rtools42/ucrt64/include/winnt.h:10020:86,
    inlined from 'void tbb::internal::generic_scheduler::init_stack_info()' at ../tbb_2020.3/src/tbb/scheduler.cpp:169:42,
    inlined from 'static tbb::internal::generic_scheduler* tbb::internal::generic_scheduler::create_worker(tbb::internal::market&, std::size_t, bool)' at ../tbb_2020.3/src/tbb/scheduler.cpp:1281:27:
C:/rtools42/ucrt64/include/psdk_inc/intrin-impl.h:838:1: warning: array subscript 0 is outside array bounds of 'long long unsigned int [0]' [-Warray-bounds=]
  838 | __buildreadseg(__readgsqword, unsigned __int64, "gs", "q")
      | ^~~~~~~~~~~~~~
In static member function 'static tbb::internal::generic_scheduler* tbb::internal::generic_scheduler::create_worker(tbb::internal::market&, std::size_t, bool)':
cc1plus.exe: note: source object is likely at address zero
In function 'long long unsigned int __readgsqword(long unsigned int)',
    inlined from '_TEB* NtCurrentTeb()' at C:/rtools42/ucrt64/include/winnt.h:10020:86,
    inlined from 'void tbb::internal::generic_scheduler::init_stack_info()' at ../tbb_2020.3/src/tbb/scheduler.cpp:169:42,
    inlined from 'static tbb::internal::generic_scheduler* tbb::internal::generic_scheduler::create_master(tbb::internal::arena*)' at ../tbb_2020.3/src/tbb/scheduler.cpp:1302:23:
C:/rtools42/ucrt64/include/psdk_inc/intrin-impl.h:838:1: warning: array subscript 0 is outside array bounds of 'long long unsigned int [0]' [-Warray-bounds=]
  838 | __buildreadseg(__readgsqword, unsigned __int64, "gs", "q")
      | ^~~~~~~~~~~~~~
In static member function 'static tbb::internal::generic_scheduler* tbb::internal::generic_scheduler::create_master(tbb::internal::arena*)':
cc1plus.exe: note: source object is likely at address zero
g++ -o tbb_statistics.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/tbb_statistics.cpp
g++ -o tbb_main.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/tbb_main.cpp
g++ -o concurrent_vector_v2.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/old/concurrent_vector_v2.cpp
g++ -o concurrent_queue_v2.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/old/concurrent_queue_v2.cpp
g++ -o spin_rw_mutex_v2.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/old/spin_rw_mutex_v2.cpp
g++ -o task_v2.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/old/task_v2.cpp
cmd /C "..\tbb_2020.3\build\generate_tbbvars.bat"
Generating local tbbvars.bat
Generating local tbbvars.sh
Generating local tbbvars.csh
g++ -E -x c++ ../tbb_2020.3/src/tbb/win64-gcc-tbb-export.def -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm   -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -D_UCRT -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include > tbb.def
g++  -o tbb.dll concurrent_hash_map.o concurrent_queue.o concurrent_vector.o dynamic_link.o itt_notify.o cache_aligned_allocator.o pipeline.o queuing_mutex.o queuing_rw_mutex.o reader_writer_lock.o spin_rw_mutex.o x86_rtm_rw_mutex.o spin_mutex.o critical_section.o mutex.o recursive_mutex.o condition_variable.o tbb_thread.o concurrent_monitor.o semaphore.o private_server.o rml_tbb.o tbb_misc.o tbb_misc_ex.o task.o task_group_context.o governor.o market.o arena.o scheduler.o observer_proxy.o tbb_statistics.o tbb_main.o concurrent_vector_v2.o concurrent_queue_v2.o spin_rw_mutex_v2.o task_v2.o    -lpsapi -shared -m64 -Wl,-L,"C;C:\rtools42\Users\Polly\Documents\.cmdstan\cmdstan-2.33.1\stan\lib\stan_math\lib\tbb" -Wl,-rpath,"C;C:\rtools42\Users\Polly\Documents\.cmdstan\cmdstan-2.33.1\stan\lib\stan_math\lib\tbb"   -Wl,--version-script,tbb.def
task.o: duplicate section `.rdata$_ZTIN3tbb4taskE[_ZTIN3tbb4taskE]' has different size
arena.o: duplicate section `.rdata$_ZTIN3tbb4taskE[_ZTIN3tbb4taskE]' has different size
scheduler.o: duplicate section `.rdata$_ZTIN3tbb4taskE[_ZTIN3tbb4taskE]' has different size
mingw32-make[1]: Leaving directory 'C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb'

NOTE: Please add C:/Users/Polly/Documents/.cmdstan/cmdstan-2.33.1/stan/lib/stan_math/lib/tbb to your PATH variable.
You may call

mingw32-make install-tbb

to automatically update your user configuration.
--- CmdStan v2.33.1 built ---

I also have no idea how to do mingw32-make install-tbb. Google only leads me to this but I honestly don’t understand to do any of the suggested things there.