travisvroman / kohi

A game engine made as part of the Kohi Game Engine series on YouTube (and Twitch!), where we make a game engine from the ground up using C and Vulkan.
https://kohiengine.com
Apache License 2.0
1.02k stars 97 forks source link

[BUG] Clang on Windows not recognizing "stdio.h" #225

Closed codinggamingandmhs closed 2 months ago

codinggamingandmhs commented 5 months ago

Clang on windows is saying: "Building for Windows..." "Building everything on windows (debug)..." --- Performing "versiongen" debug build --- versiongen/src/main.c... versiongen/src/main.c:1:10: fatal error: 'stdio.h' file not found

include

     ^~~~~~~~~

1 error generated. make: *** [Makefile.executable.mak:142: obj/versiongen/src/main.c.o] Error 1 Error:2

To Reproduce Steps to reproduce the behavior:

  1. Type "build-debug"
  2. See error

Expected behavior The engine to build

Specs:

IvanPostu commented 5 months ago

Hi, I've had exactly this issue for Windows 10, here is how I tackled it:

codinggamingandmhs commented 4 months ago

I'll try reinstalling clang. Thank you for the help!

codinggamingandmhs commented 4 months ago

Huh. It didn't work.

codinggamingandmhs commented 4 months ago

I've also tried using VS 2022's command prompt. It might be a clang problem, because it didn't do that to me with gcc. That's why I use it. Not that I'm against Travis. I'll try modifying the build script to use gcc instead.

codinggamingandmhs commented 4 months ago

Do I have to spam stuff? It doesn't work with GCC either, it spits out 30 error messages. (Literally.)

travisvroman commented 2 months ago

@codinggamingandmhs Just catching up on issues - apologies for the delay. I've had issues installing clang via the VS installer. What I've always done in the past is install VS with the C++ build tools and then install clang via the clang installer from their site. I had this be the process I had to use as recently as a month ago. Give this a shot and let me know if it helps.

I need to put aside some time to come up with a newer, up-to-date process for this that is documented, it seems.

codinggamingandmhs commented 2 months ago

I think I fixed it. Thanks for the help, @travisvroman and @IvanPostu .