Build problems with Windows

  • Furry_02
    11th Sep 2021 Member 0 Permalink

    For some reason, when I try to build with either VS or just command line, it says this:

    The Meson build system
    Version: 0.59.1
    Source dir: C:\Users\[REDACTED]\source\repos\TPT
    Build dir: C:\Users\[REDACTED]\source\repos\TPT\build-debug-vs
    Build type: native build
    Project name: the-powder-toy
    Project version: the.cake.is.a.lie

    meson.build:1:0: ERROR: Compiler cl can not compile programs.

     

    Here's the log file it give me:

    Build started at 2021-09-11T12:11:30.822756
    Main binary: c:\users\[REDACTED]\appdata\local\programs\python\python39\python.exe
    Build Options: -Dbackend_startup_project=powder -Dbackend=vs
    Python system: Windows
    The Meson build system
    Version: 0.59.1
    Source dir: C:\Users\[REDACTED]\source\repos\TPT
    Build dir: C:\Users\[REDACTED]\source\repos\TPT\build-debug-vs
    Build type: native build
    Project name: the-powder-toy
    Project version: the.cake.is.a.lie
    Sanity testing C compiler: cl
    Is cross compiler: False.
    Sanity check compiler command line: cl sanitycheckc.c /Fesanitycheckc.exe /MDd /nologo /showIncludes /link
    Sanity check compile stdout:
    sanitycheckc.c
    LINK : fatal error LNK1104: cannot open file 'kernel32.lib'

    -----
    Sanity check compile stderr:

    -----

    meson.build:1:0: ERROR: Compiler cl can not compile programs.

     

    I have no clue what's wrong here, I was able to build TPT before..

  • jacob1
    11th Sep 2021 Developer 0 Permalink
    Make sure that you are using "x64 Native Tools Command Prompt for VS", and not cmd.exe. You need the visual studio command prompt in order to compile.
  • Furry_02
    11th Sep 2021 Member 0 Permalink

    I tried both, both gave the same error.

     

    Edit: I just tried doing just 'meson build-debug', same error.

    Edited once by Furry_02. Last: 11th Sep 2021
  • LBPHacker
    11th Sep 2021 Developer 0 Permalink
    You're having the same problem as the person who opened this thread (warning, messy, lots of edits and logs). We've seen other threads about this but the authors gave up and disappeared before a solution could be found. This one person managed to fix the issue somehow, seemingly by completely reinstalling VS. Note: they reported that it didn't help before finally reporting that it did help; inconsistencies like that dominate the thread, so it would be really nice if we had at least one thread (this one?) where we go from issue to solution in a straight line.
  • Furry_02
    11th Sep 2021 Member 0 Permalink

    I thiiink I know the issue. For some reason, kernel32 isn't being seen by Meson, even though VS and literally every other program can see it. Is there a enviorment variable I have to set or something? Or is there options for directly specifying a link directory?

  • LBPHacker
    11th Sep 2021 Developer 0 Permalink
    It's not meson that has to see kernel32.lib but cl.exe, a program provided by vs. (In any case, no other programs ever need kernel32.lib, so you can't know whether they see it or not.) Environment variables are set up by the vs prompt, so if it sets them up incorrectly, there's not much we can do other than suggesting a reinstall. Feel free to play around with environment variables, but what will most likely happen even if you somehow make the sanity check test pass is you'll get weirder errors later down the line.
    Edited once by LBPHacker. Last: 11th Sep 2021
  • Furry_02
    11th Sep 2021 Member 0 Permalink

    Ah.. I'm not sure if reinstalling VS will screw up my existing projects, would it?

  • LBPHacker
    11th Sep 2021 Developer 0 Permalink
    It won't.
  • Furry_02
    11th Sep 2021 Member 0 Permalink

    Reinstalling didn't do anything, same error.

  • LBPHacker
    11th Sep 2021 Developer 0 Permalink
    Can you join #powder-dev on libera?