I have compiled mingw-w64-headers
and mingw-w64-crt
as described here.My issue is how to get gcc to use them.
I have tried the following to no avail:
SET mingw_dir=C:\msys64\mingw-w64gcc -g -L %mingw_dir%\lib^ -I %mingw_dir%\include^ -Wl,--rpath=%mingw_dir%\lib^ test.c -o test
It fails to compile giving:
../lib/crt2.o: in function 'pre_c_init':crt/crtexe.c:145: undefined reference to '__p__commode'
This seems to be an issue with ld
, however I'm not sure how to solve it.