“archive has no index” error when unit testing on native with Mingw-w64
With a unit testing project as native test using MinGW64, installed as in the doc, I encountered a mingw32/bin/ld.exe: .pio\build\native.... .a: error adding symbols: archive has no index; run ranlib to add one error message. Via this post I found that MinGW 13.2 seems to be the reason for the problem; after downgrading to MinGW 12.2.0.03042023 solved the issue. (installation via chocolatey; I assume it works also with other installation ways) Maybe this should be mentioned in the doc.
I use 13.2 and MinGW 12.2.0.the same problem
I found the cause of the problem. It was because there was other software, on the path , high priority, MinGW , other software installed.
The solution is to run the “ar” command from the vsc command line, which prints out it‘s path.
Then remove the high priority ar from the path. reboot pc