Compiler mingw32 (Linux platform, target - Windows), linking, problem

The problem is that when running on Windows, printf is not released (windows.h is included in the project normally), gdb does not display errors, the paths are correct (checked). Tell me what's wrong?

Make-file :

MainCpp=main GppCompilerWin32="///usr/bin/i586-pc-mingw32-g++" RemoveDebugInfoGppCompilerWin32="///usr/bin/i586-pc-mingw32-strip" LibWin=-I"///usr/i586-pc-mingw32/sys-root/mingw/include" -L"///usr/i586-pc-mingw32/sys-root/mingw/lib" -lmingw32 -luser32 -lgdi32 -lwinmm GppCompilerWin32Flags=-mwindows win32: $(GppCompilerWin32) $(GppCompilerWin32Flags) -o $(MainCpp)win32.exe $(MainCpp).cpp $(LibWin) $(RemoveDebugInfoGppCompilerWin32) $(MainCpp)win32.exe 
  • problem with linking or launching? really decide. - KoVadim
  • Does hello world work? - VladD
  • and the file size does not change when changing the list of libraries and the launch does not printf print. the program itself #include <windows.h> #include <stdio.h> int main () {printf ("HELLO \ n"); system ("pause"); return 0; } - nebrit63
  • maybe just makefile verifies that the binary is already there, does not recompile it for a new one? remove the binary and rebuild. - KoVadim
  • No, the file change date is changing, but still I tried what you said - it did not help - nebrit63

1 answer 1

The problem is that when run on Windows, printf is not released (windows.h is included in the project normally)

windows.h has nothing to do with printf! printf is a library function clib. Check your compiler and build system.

If interest is not lost - raise the topic, I have a solution.