Here’s my gcc
>g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=C:/gcc/bin/../libexec/gcc/x86_64-w64-mingw32/14.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../src/gcc-14.1.0/configure --host=x86_64-w64-mingw32 --enable-
languages=c,c++ --enable-seh-exceptions --enable-threads=posix --disable-nls --disable-
shared --enable-static --enable-fully-dynamic-string --enable-lto --enable-plugins --
enable-libgomp --with-dwarf2 --enable-mingw-wildcard=platform --disable-win32-registry -
-enable-version-specific-runtime-libs --prefix=/mingw64-64 --with-sysroot=/mingw64-64 --
target=x86_64-w64-mingw32 --enable-targets=all --enable-checking=release --with-
gmp=/usr/new-gcc/lib/gmp-6.1.2 --with-mpfr=/usr/new-gcc/lib/mpfr-3.1.6 --with-
mpc=/usr/new-gcc/lib/mpc-1.1.0 --with-isl=/usr/new-gcc/lib/isl-0.18 --with-
cloog=/usr/new-gcc/lib/cloog-0.18.4 --with-host-libstdcxx='-lstdc++ -lsupc++' --disable-
cloog-version-check --enable-cloog-backend=isl
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.1.0 (GCC)
Whenever i try to compile code, say this simple program called test:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
If i compile using: g++ -m64 -o test.exe test.cpp
And then try to run from cmd, i get this error:
While if i compile using: g++ -m32 -o test.exe test.cpp
it runs just fine.
What’s the issue here?