I compiled c++ file with mingw32. It's compiled successfully but not working. What's the problem?
my command : x86_64-w64-mingw32-g++ -o xx test.cpp
I compiled c++ file with mingw32. It's compiled successfully but not working. What's the problem?
my command : x86_64-w64-mingw32-g++ -o xx test.cpp
Just because a program compiles does not in any way mean that it is free of errors. It only means that it is syntactically valid.
The compiler has no way of knowing your intentions, so it obviously cannot flag any logic errors in your code.
There are also a lot of things in C++ that are valid syntax but that you are not allowed to do and invoke undefined behaviour. The compiler is not required to flag such issues, you have to know all the rules and abide by them. If any part of your code contains UB, the compiler has no obligation to generate anything sensible for any parts of your program.
That something compiles means next to nothing as far as correctness goes. It's a very low bar.