Kode/Kha

Compiling hxcpp projects stopped working on Windows (even for empty example)

MoritzBrueckner opened this issue · 10 comments

Describe the bug
When compiling an arbitrary Kha/hxcpp project in Visual Studio 2019 on Windows, the compilation fails. This is even the case for the empty sample project. The last time I compiled to hxcpp was some while ago so I unfortunately can't tell when it worked before.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the empty sample project
  2. Run Kha/make windows
  3. Open the generated .sln file
  4. A bunch of errors occur:
    • for (almost?) every .cpp file:
      [...]\Empty\build\windows-build\Sources\src\Main.cpp(2,10): fatal error C1083: Datei (Vorkompilierte Headerdatei) kann nicht geöffnet werden: "x64\Debug\Empty.pch": No such file or directory (the German part means Could not open file (precompiled header file)
    • also, if I open one of the .cpp files from the errors above: Could not open the file "Source": "hxcpp.h" (translated; in regards to #include <hxcpp.h>)

Execution Environment:

  • Host system: Windows 10
  • Target system: Windows 10
  • IDE used: Visual Studio 2019
  • Kha revision: a57f47b (current master), unmodified and up-to-date submodules.
  • Kha build output:
    λ "../Kha/make" windows
    Using Kha (a57f47bc) from [...]\Forks\Kha
    Creating Kha project.
    Compiling shader 1 of 8 (painter-colored.frag.glsl).
    Compiling shader 2 of 8 (painter-colored.vert.glsl).
    Compiling shader 3 of 8 (painter-image.frag.glsl).
    Compiling shader 4 of 8 (painter-image.vert.glsl).
    Compiling shader 5 of 8 (painter-text.frag.glsl).
    Compiling shader 6 of 8 (painter-text.vert.glsl).
    Compiling shader 7 of 8 (painter-video.frag.glsl).
    Compiling shader 8 of 8 (painter-video.vert.glsl).
    Using Kinc (69f8242d) from [...]\Forks\Kha\Kinc
    kincfile found.
    Creating Windows project files.
    Done.
    

Can not reproduce the problem. GitHub CI is also looking good.

Looks like this issue has solved itself, I temporarily checked out the latest Kinc master and it works again, even after returning to the version from 3 days ago that didn't work above (which is the current one for the Kinc submodule in this repository). Maybe Git messed with some files locally. I hope I didn't waste too much of your time, thanks a lot for giving it a try!

This issue seems to have repeated. I'm having it, and my buddy is as well. We're working on the EchoSystem https://github.com/jrdoughty/EchoSystem, but I did make a blank kha project using the init from the vs code extention to the same effect.

I have absolutely no idea.

Could it be related to the version of kha in that comes with the extention?

I won't be able to test until tonight (another 8 hrs or so)

Unlikely - still, you should really only use the integrated version for your first test-runs, it's almost always way behind and unsupported.

ok, I'll work to get on the latest and greatest and see if this resolves

That resolved kha building to Windows. I've got other issues now, but that'll be something I try to work through and create a different issue for. It'd be great if the extensions could get another update. Especially krom. I know that's not a painless process though.

The Kha extension gets semi-regular updates which are actually painless but even when it's updated you really shouldn't use it's internal Kha - you can't version it. It is absolutely only intended as a starting point. Treat it like a demo mode.
Krom is totally different story, the problem is not the extension, Krom itself needs some work.