2
votes

After a previous issue, I gave up and blew my installation away to start afresh. Reinstalling MinGW, Code Blocks (with MinGW) and SDL. Following this tutorial (http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/codeblocks/index.php) to the letter. And every time I try to compile, no matter if the project is new or not, will suffer from the error message in the topic title.

I have tried this solution ("winapifamily.h: No such file or directory" when compiling SDL in Code::Blocks) and it still prevails. I have blown the installation to start again. I have now run out of options. Can anyone tell me why this is still happening?

I am using the latest versions of MinGW, SDL and Code Blocks.

2
I'm not sure why it happens, but if you use a version before 2.0.3 it should be fine without the solution. And if the solution works what is the problem?Leonardo
The problem is I have tried it with AND without the solution. The problem still occurs no matter if I use the solution or not.Jeremy Beare
Oh, sorry I thought you said the solution fixed it but that doesnt make sense. Try adding the path to all the subdirectories in C:\Program Files (x86)\Windows Kits\8.0\IncludeLeonardo
Could I ask where I post these paths? And which subdirectories?Jeremy Beare
Just add these paths to build options -> search directories -> compiler the folder paths to shared um and winrt. Although a subset of those may work too.Leonardo

2 Answers

5
votes

How about hardcoding the include directory to your project? winapifamily.h should be on C:\Program Files (x86)\Windows Kits\8.0\Include\shared. You can add it to the "search directories" tab in project build options.

Make sure to check the file exist in the location first. If it doesn't, you may need to install windows 8 sdk.

0
votes

If you go through that answer you posted there is the following option:

Go to your SDL_platform.h file located in the include/SDL2 directory of your library. Replace the code with the updated header file located here