V version: fa8f5df81704f77a97c7e7b8875a82d281b82d9c
OS: Windows 10
What did you do?
cloned and then ran ./make.bat
What did you expect to see?
v build
What did you see instead?
PS C:\> git clone https://github.com/vlang/v
Cloning into 'v'...
remote: Enumerating objects: 104, done.
remote: Counting objects: 100% (104/104), done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 52509 (delta 41), reused 52 (delta 19), pack-reused 52405R
Receiving objects: 100% (52509/52509), 19.69 MiB | 2.00 MiB/s, done.
Resolving deltas: 100% (37161/37161), done.
PS C:\> cd v
PS C:\v> .\make.bat
Building V
Cloning vc...
Attempting to build v.c with GCC...
> GCC not found
Attempting to build v.c with MSVC...
Failed to compile - Create an issue at 'https://github.com/vlang/v' with the following info:
v_win.c
vc\v_win.c(234): fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory
Exiting from error
Workaround
./make.bat -tcc managed to build fully.
Interesting. So it is an msvc problem.
Which version of msvc do you have?
Does v self work now that you have a working V executable?
Seem to be running Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29111 for x86. Now I have a working executable self building seems to work fine. Is there a reason not to package a build into the releases? Surely then there'd be no need to install a c compiler for simple work.
All releases contain a prebuilt v executable. If they do not, then there's probably been a human error in packaging.
A C compiler is always needed, but tcc will be cloned and used if no existing compiler is found, this way a binary will always be produced.
I'm probably misunderstanding but I thought that being able to self compile meant that it can compile v (such as the code for v itself) into native code using only the v compiler? Surely that compiler could be used instead of tcc etc. Like I said, I'm probably wrong here.
No, by default V outputs C, and then calls a C compiler (gcc, clang, msvc, tcc, etc.) installed on our system to generate a binary from there.
V also has an experimental x64 backend that generates native executables by itself, but that's both Linux-specific and very limited currently.
If you want to know the reason why we compile to C rather than generating executables natively, you can read about that here.
Most helpful comment
No, by default V outputs C, and then calls a C compiler (gcc, clang, msvc, tcc, etc.) installed on our system to generate a binary from there.
V also has an experimental x64 backend that generates native executables by itself, but that's both Linux-specific and very limited currently.
If you want to know the reason why we compile to C rather than generating executables natively, you can read about that here.