Question: where do I get and how do I make strsafe.h work with Tiny C Compiler by Bellard.
Here is my Journey with MinGW header files, which is unsuccessful,
as I was unable to make strsafe.h headers of MinGW work with Tiny C Compiler.
The beginnings.
I wanted to run/compile some text-editor project written in C and
suddenly strsafe.h header was missing in the Tiny C Compiler \include folder.
jittey-main>tcc -run main.c
main.c:4: error: include file 'strsafe.h' not found
strsafe.h header seems to not be included in the Tiny C Compiler.
So I tried to download strsafe.h header from mingw project (strsafe.h)
I placed it into the /include folder and suddenly another missing header file poped up.
tcc -run main.c
In file included from main.c:4:
other/strsafe.h:9: error: include file '_mingw_unicode.h' not found
Alright, I tried to find _mingw_unicode.h in the mingw project.
And here I found it:
mingw project (_mingw_unicode.h)
I placed it into /include folder just like before.
tcc -run main.c
In file included from main.c:4:
other/strsafe.h:13: error: include file 'specstrings.h' not found
Once again I was welcomed with another missing header file.
Here it is: mingw project (specstrings.h)
I placed it into /include folder just like before.
tcc -run main.c
In file included from main.c:4:
In file included from other/strsafe.h:13:
other/specstrings.h:12: error: include file 'sal.h' not found
Now this is getting repetitive... Alright It's here.
mingw project (strsafe.h)
I placed it into /include folder just like before.
Last one to resolve? I hope so.
tcc -run main.c
In file included from main.c:4:
In file included from other/strsafe.h:13:
other/specstrings.h:336: error: include file 'driverspecs.h' not found
Here it is: mingw project (driverspecs.h)
I placed it into /include folder just like before.
Slight change in errors. strsafe.h header contains C++ syntax? I'm stuck here.
From this error I guess that strsafe.h header from the MinGW project is not compatible with C89 C99 or C11 languages.
tcc -run main.c
In file included from main.c:4:
other/strsafe.h:131: error: ',' expected (got "dwFlags")
The exact error line can be found here: strsafe.h:131: error
I don't know what to do now.
This is incomplete answer.
Does not answer how to setup TCC with windows-10-sdk.
Location of
strsafe.hI did some research and I've found that
strsafe.his part of windows-10-sdkThe setup file of windows-10-sdk is named winsdksetup.exe
The setup size is unexpectedly small. (1,29 MB)
However, the setup downloads and produces additional (1,86 GB) after installation.
windows-10-sdk gets installed into this directory by default:
C:\Program Files (x86)\Windows Kits\10After installation of windows-10-sdk
The location of strsafe.h is here:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\strsafe.hThe strsafe.lib file can be found here:
10.0.19041.0is a version number of windows-10-sdk.x86x64arm64armare the instruction set architectures.Some additional required .h headers can be found here
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\Further failure to compile using Windows SDK
I had some trials to compile the previously mentioned text-editor project.
I found some instructions regarding compiling the project
with other compilers rather than Tiny C Compiler
I tried Linking the include .h headers of Windows SDK
But it still came out as a failure.
I received the following errors:
I suspect this error might be showing that the
windows.hthat already exists in Tiny C Compiler and is incompatible with the headers of Windows SDK.I think Tiny C Compiler requires modified headers of Windows SDK, that could merge well.
Back to MinGW
After installation of Windows SDK and linking the .lib files.
As the same headers problems still occur and persist.
I think setting up TCC with MinGW might be worth a try.
One more suggestion is to re-compile Tiny C Compiler with MinGW headers.
But I'm not sure about that, not sure if it would do anything.
But I might try at some less busy day.
Compiling a file with TCC on windows with a library from C99