Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
woojamon opened this issue Jan 29, 2024 · 2 comments

Comments

@woojamon
Copy link

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
@woojamon
Copy link
Author

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.

@TimWhiting
Copy link
Collaborator

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.

@TimWhiting TimWhiting reopened this Jan 31, 2024
@TimWhiting TimWhiting changed the title fatal error: 'inttypes.h' file not found Improve Developer Documentation for Developing on Windows: error 'inttypes.h' file not found Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants