Waitrud Weber’s blog

things and reminders for memories

windows-make: c++: Compilation in the way which is a trivia.

1.We exclude "tchar.h" but it is in all includion.

1-1.We can include "tchar.h" if we use mingw-32.exe for a compilation.

 

2.We can choose the library-i686.

*

Raw - select -
1 mingw-32.exe o -
2 tchar.h o -
3 g++ x -
4 C:\DEV\xpack-windows-build-tools-4.4.1-3\bin\make.exe 

o

x(x86_64)

-
5 x86_64(WIN64) o(Raw8) -
6 i686(WIN32) o -
7 MinGW o -
8 MinGW\bin\make.exe o -
9 strsafe.h x -
- - - -

 

The above is like the previous one, which means a way of compilation doesn't change so much.

StringCchPrintfA function (strsafe.h) - Win32 apps | Microsoft Learn

mingw32-g++ -Wall -O3 -I C:\DEV\x86_64\x86_64-w64-mingw32\include -L C:\DEV\x86_64\x86_64-w64-mingw32\lib -mwindows -lgdi32 -lws2_32 -lwsock32 -o thread_print.o -c thread_print.cpp
thread_print.cpp:5:21: fatal error: strsafe.h: No such file or directory
 #include <strsafe.h>
                     ^
compilation terminated.
Makefile:73: recipe for target 'thread_print.o' failed
make: *** [thread_print.o] Error 1
PS C:\Users\benetton\Documents\source\axex-20230816> dir C:\DEV\x86_64\x86_64-w64-mingw32\include\strsafe.h


    directory: C:\DEV\x86_64\x86_64-w64-mingw32\include


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        2025/10/31     18:37          73349 strsafe.h

 

PS C:\Users\benetton\Documents\source\axex-20230816> make all
mingw32-g++ -Wall -O3 -I C:\DEV\i686\i686-w64-mingw32\include -L C:\DEV\i686\i686-w64-mingw32\lib -mwindows -lgdi32 -lws2_32 -lwsock32 -o thread_print.o -c thread_print.cpp
thread_print.cpp:5:21: fatal error: strsafe.h: No such file or directory
 #include <strsafe.h>
                     ^
compilation terminated.
Makefile:73: recipe for target 'thread_print.o' failed
make: *** [thread_print.o] Error 1
PS C:\Users\benetton\Documents\source\axex-20230816> dir C:\DEV\i686\i686-w64-mingw32\include\strsafe.h


    directory: C:\DEV\i686\i686-w64-mingw32\include


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        2025/11/05     19:40          73349 strsafe.h