Recently switched from MinGW to MinGW-w64. I installed everything, put all the paths in ide Code :: block. I do the test program Hello World, I compile - on the screen emptiness. I go to the folder where the project binary is. I launch it and it issues 10 wines - It is impossible to launch this application on your PC. How to be? Already broke his head.
Closed due to the fact that off-topic participants Abyx , Grundy , user194374, Alex , aleksandr barakin 1 Jan '17 at 22:23 .
It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:
- “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Abyx, Grundy, Community Spirit, Alex
1 answer
If the binary has appeared, then the compilation was successful and the problem is in the launch of your application.
The problem of launching the application may be due to the absence of dependent libraries in the folder with the binary or in the PATH or else because of a lot of reasons .
To view which libraries your exe depends on, you can use the special utility Dependency Walker or Lister plugin for TotalCommander:
As you can see from the screenshot, the program is compiled with the MinGW libgcc_s_dw2-1.dll runtime dependency and the location of this library is unknown (in fact, it lies in the \mingw-w64\mingw32\bin\ ).
To solve this problem, you must either add the path to the dependent library in PATH , or put it next to exe (and all the libraries it depends on), or when compiling the project, specify that it link statically (specifically, for the libgcc_s_dw2-1.dll static linking) libgcc_s_dw2-1.dll , in the project settings, add a linker flag: -static-libgcc ).
Upd: As it turned out from the comments, there was an attempt to launch a 64-bit binary on a 32-bit system. Hence the conclusion that you need to carefully look at what platform you are building your application. In the finished binaries, you can also find out how big it is (32/64 bits). Information about this is in the PE headers and there are programs for viewing these headers (for example, PE Explorer or the same Lister plugin for TC):
- I added -static-libgcc but unfortunately did not help ... File weight increased, yes. But still the same error - Unable to run this application on your PC - Corle
- one@Corle Complete the question with the code you are compiling. Give the assembly logs, specify the system and binary digits. Try running the binary on a different version of Windows, on another computer or in a virtual machine. Try recommendations on the link that I gave in the answer ( this ). Put your binary on the exchanger and give a link so that we can check its performance. - zed
- rgho.st/7DD72p5fQ here is the project itself, the logs are there. I would be very grateful if you help! By the way, the funny thing is that if you run a binary from under wine in linux - it works - Corle
- @Corle for your link can not download anything. - zed
- one@Corle In the Code :: Blocks settings, specify the correct compiler. Now there is
x86_64-w64-mingw32-gcc.exe, and it should bei686-w64-mingw32-gcc.exe. - zed

