When I compile c++ and c files together with the following command:
g++ io.c *.cpp -o main -D__STDC_FORMAT_MACROS
error occurs:
g++.exe: fatal error:cannot execute ‘C:/TDM-GCC-32/bin/../libexec/gcc/mingw32/9.2.0/collect2.exe’: CreateProcess: No such file or directory
And in fact,the collect2.exe
exists in the correct directory.I've tried all the solutions provided online, but no one worked.(etc. set/clear environment values,try other versions of mingw32...)The only reason I could think up is that the g++.exe
uses /
in directories, and windows uses \
instead. So is there any other solutions for the error?