koka-lang / koka

Koka language compiler and interpreter

Home Page:http://koka-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve Developer Documentation for Developing on Windows: error 'inttypes.h' file not found

woojamon opened this issue · comments

I installed koka on Windows 11 using the CMD given in the manual installation instructions. It installed clang and llvm and all during the process. However, I can't compile any koka files.

PS C:\Users\woojamon\Source\koka> "fun main() ()" > main.kk
PS C:\Users\woojamon\Source\koka> koka main.kk
compile: main.kk
loading: std/core
loading: std/core/types
loading: std/core/undiv
compile: c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/lib/std/core/undiv.kk
check  : std/core/undiv
In file included from .koka/v3.0.4/clang-cl-debug/std_core_undiv.c:2:
In file included from .koka/v3.0.4/clang-cl-debug/std_core_undiv.h:5:
In file included from c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include\kklib.h:38:
c:\Program Files\LLVM\lib\clang\17\include\inttypes.h(21,15): fatal error: 'inttypes.h' file not found
   21 | #include_next <inttypes.h>
      |               ^~~~~~~~~~~~
1 error generated.
failure during code generation:
  error  : command failed (exit code 1)
  command: "c:/Program Files/LLVM/bin/clang-cl.exe" -DWIN32 -nologo -Wno-everything -Wall -Wextra -Wpointer-arith -Wshadow -Wstrict-aliasing -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wno-cast-qual -Wno-undef -Wno-reserved-id-macro -Wno-unused-macros -Wno-cast-align -Wno-extra-semi-stmt -Wno-extra-semi -Wno-float-equal -MDd -Zi -O1 -D__clang_msvc__ -EHs -TP -c -I c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include -DKK_MIMALLOC=8 -Fo.koka/v3.0.4/clang-cl-debug/std_core_undiv.obj .koka/v3.0.4/clang-cl-debug/std_core_undiv.c

loading: std/core/hnd
compile: c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/lib/std/core/hnd.kk
check  : std/core/hnd
In file included from .koka/v3.0.4/clang-cl-debug/std_core_hnd.c:2:
In file included from .koka/v3.0.4/clang-cl-debug/std_core_hnd.h:5:
In file included from c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include\kklib.h:38:
c:\Program Files\LLVM\lib\clang\17\include\inttypes.h(21,15): fatal error: 'inttypes.h' file not found
   21 | #include_next <inttypes.h>
      |               ^~~~~~~~~~~~
1 error generated.
failure during code generation:
  error  : command failed (exit code 1)
  command: "c:/Program Files/LLVM/bin/clang-cl.exe" -DWIN32 -nologo -Wno-everything -Wall -Wextra -Wpointer-arith -Wshadow -Wstrict-aliasing -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wno-cast-qual -Wno-undef -Wno-reserved-id-macro -Wno-unused-macros -Wno-cast-align -Wno-extra-semi-stmt -Wno-extra-semi -Wno-float-equal -MDd -Zi -O1 -D__clang_msvc__ -EHs -TP -c -I c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include -DKK_MIMALLOC=8 -Fo.koka/v3.0.4/clang-cl-debug/std_core_hnd.obj .koka/v3.0.4/clang-cl-debug/std_core_hnd.c

loading: std/core/exn
compile: c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/lib/std/core/exn.kk
check  : std/core/exn
In file included from .koka/v3.0.4/clang-cl-debug/std_core_exn.c:2:
In file included from .koka/v3.0.4/clang-cl-debug/std_core_exn.h:5:
In file included from c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include\kklib.h:38:
c:\Program Files\LLVM\lib\clang\17\include\inttypes.h(21,15): fatal error: 'inttypes.h' file not found
   21 | #include_next <inttypes.h>
      |               ^~~~~~~~~~~~
1 error generated.
failure during code generation:
  error  : command failed (exit code 1)
  command: "c:/Program Files/LLVM/bin/clang-cl.exe" -DWIN32 -nologo -Wno-everything -Wall -Wextra -Wpointer-arith -Wshadow -Wstrict-aliasing -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wno-cast-qual -Wno-undef -Wno-reserved-id-macro -Wno-unused-macros -Wno-cast-align -Wno-extra-semi-stmt -Wno-extra-semi -Wno-float-equal -MDd -Zi -O1 -D__clang_msvc__ -EHs -TP -c -I c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include -DKK_MIMALLOC=8 -Fo.koka/v3.0.4/clang-cl-debug/std_core_exn.obj .koka/v3.0.4/clang-cl-debug/std_core_exn.c

loading: std/core/bool
loading: std/core/int
loading: std/core/order
loading: std/core/char
loading: std/core/vector
compile: c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/lib/std/core/vector.kk
check  : std/core/vector
In file included from .koka/v3.0.4/clang-cl-debug/std_core_vector.c:2:
In file included from .koka/v3.0.4/clang-cl-debug/std_core_vector.h:5:
In file included from c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include\kklib.h:38:
c:\Program Files\LLVM\lib\clang\17\include\inttypes.h(21,15): fatal error: 'inttypes.h' file not found
   21 | #include_next <inttypes.h>
      |               ^~~~~~~~~~~~
1 error generated.
failure during code generation:
  error  : command failed (exit code 1)
  command: "c:/Program Files/LLVM/bin/clang-cl.exe" -DWIN32 -nologo -Wno-everything -Wall -Wextra -Wpointer-arith -Wshadow -Wstrict-aliasing -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wno-cast-qual -Wno-undef -Wno-reserved-id-macro -Wno-unused-macros -Wno-cast-align -Wno-extra-semi-stmt -Wno-extra-semi -Wno-float-equal -MDd -Zi -O1 -D__clang_msvc__ -EHs -TP -c -I c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include -DKK_MIMALLOC=8 -Fo.koka/v3.0.4/clang-cl-debug/std_core_vector.obj .koka/v3.0.4/clang-cl-debug/std_core_vector.c

loading: std/core/string
compile: c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/lib/std/core/string.kk
check  : std/core/string
In file included from .koka/v3.0.4/clang-cl-debug/std_core_string.c:2:
In file included from .koka/v3.0.4/clang-cl-debug/std_core_string.h:5:
In file included from c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include\kklib.h:38:
c:\Program Files\LLVM\lib\clang\17\include\inttypes.h(21,15): fatal error: 'inttypes.h' file not found
   21 | #include_next <inttypes.h>
      |               ^~~~~~~~~~~~
1 error generated.
failure during code generation:
  error  : command failed (exit code 1)
  command: "c:/Program Files/LLVM/bin/clang-cl.exe" -DWIN32 -nologo -Wno-everything -Wall -Wextra -Wpointer-arith -Wshadow -Wstrict-aliasing -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wno-cast-qual -Wno-undef -Wno-reserved-id-macro -Wno-unused-macros -Wno-cast-align -Wno-extra-semi-stmt -Wno-extra-semi -Wno-float-equal -MDd -Zi -O1 -D__clang_msvc__ -EHs -TP -c -I c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include -DKK_MIMALLOC=8 -Fo.koka/v3.0.4/clang-cl-debug/std_core_string.obj .koka/v3.0.4/clang-cl-debug/std_core_string.c

loading: std/core/sslice
compile: c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/lib/std/core/sslice.kk
check  : std/core/sslice
In file included from .koka/v3.0.4/clang-cl-debug/std_core_sslice.c:2:
In file included from .koka/v3.0.4/clang-cl-debug/std_core_sslice.h:5:
In file included from c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include\kklib.h:38:
c:\Program Files\LLVM\lib\clang\17\include\inttypes.h(21,15): fatal error: 'inttypes.h' file not found
   21 | #include_next <inttypes.h>
      |               ^~~~~~~~~~~~
1 error generated.
failure during code generation:
  error  : command failed (exit code 1)
  command: "c:/Program Files/LLVM/bin/clang-cl.exe" -DWIN32 -nologo -Wno-everything -Wall -Wextra -Wpointer-arith -Wshadow -Wstrict-aliasing -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wno-cast-qual -Wno-undef -Wno-reserved-id-macro -Wno-unused-macros -Wno-cast-align -Wno-extra-semi-stmt -Wno-extra-semi -Wno-float-equal -MDd -Zi -O1 -D__clang_msvc__ -EHs -TP -c -I c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/kklib/include -DKK_MIMALLOC=8 -Fo.koka/v3.0.4/clang-cl-debug/std_core_sslice.obj .koka/v3.0.4/clang-cl-debug/std_core_sslice.c

loading: std/core/list
compile: c:/Users/woojamon/AppData/Local/koka/share/koka/v3.0.4/lib/std/core/list.kk
check  : std/core/list
user interrupt

Turns out I had to use the visual studio installer to install the "Desktop development with C++" workload, which fixed the inttypes.h error.
image

Then I was getting an error concerning #include <vcruntime.h>. I resolved that by installing the latest of all the MSVC components I could find.
image

I could probably have gotten away with more minimal components, but didn't want to spend the time figuring that out. I'm able to compile koka files on my Windows 11 PC though, so I'm a happy camper now.

Glad to see you figured this out. If you don't mind, I'll reopen it so we can remember to add this to the README. I think I had these components installed for other reasons, so I had no trouble when I did it, but this seems like something that we need to add for other contributors.