“Dual-target” MinGW-w64 isn't really dual-target?

后端 未结 2 464
生来不讨喜
生来不讨喜 2020-12-16 16:17

When I try to compile a 32-bit program on a 64-bit host with MinGW-builds:

T:\\mingw64>.\\bin\\g++ -m32 Test.cpp

I get:

         


        
2条回答
  •  天涯浪人
    2020-12-16 17:07

    Although the General Usage Instructions page on MinGW-w64 Wiki claims that the MinGW-builds project supplies dual-target compilers, this is not completely true anymore. The SEH variants (which come starting from GCC 4.8.0) are only single-target. You can see it yourself by inspecting the directory structure of their distributions, i.e. they contain only the libraries with either 64- or 32-bit addressing, but not both. Furthermore, recently it was confirmed on the mailing list of MinGW-builds.

    On the other hand, plain old SJLJ distributions are indeed dual-target. If you get:

    The application was unable to start correctly (0xc000007b). Click OK to close the application.

    when running the 64-bit application produced by these distributions, then you should recall that 0xC000007B is the code of STATUS_INVALID_IMAGE_FORMAT, which is a good evidence that 64-bit application is trying to load 32-bit DLLs. Probably, you have added \bin to PATH, whereas should have added \i686-w64-mingw32\lib64 for 64-bit applications to run properly.

提交回复
热议问题