Closed Dreamerxic closed 1 year ago
This looks like you've got an old "as" early in your PATH which doesn't belong to w64devkit. Perhaps it's from an old, leftover MinGW installation that had added itself to your PATH. You wouldn't have noticed it in older w64devkit releases that only had GCC 10, which still defaulted to DWARF 4.
Check "which as" which should point at an "as.exe" inside w64devkit. Check "g++ -print-prog-name=as" to see what assembler GCC is using. Check PATH for anything suspicious like a MinGW install. Check the "edit environment variables for your account" and "edit the system environment variables" dialogs for anything suspicious. Check that you're calling the intended compiler with "which g++" and that it's using the correct linker using "g++ -print-prog-name=ld" and "which ld". The "--version" option for both "as" and "ld" should report Binutil 2.39.
I can confirm that a "hello world" C++ program compiles and works fine, even from cmd.exe, when using w64devkit on a fresh Windows installation, at least for XP, 7, 10, and 11.
(This issue was one of my motivations for w64devkit. With no installation, it won't contaminate your PATH or registry as a number of other tools do, including whatever is putting an as.exe in your PATH. Removal is just a matter of deleting the w64devkit directory.)
It seems that the old version w64devkit in PATH covered the new one. After removing the old PATH, command option -g in cmd.exe works correctly. Thanks.
A command like:
works properly in w64devkit.exe. But in cmd.exe, this command prints
In cmd.exe, commands like:
works, and
doesn't.
I had never met such a problem with an old version w64devkit, I can't get more details from it. Hope the issue would be useful. Please tell me if I do anything wrong.