V: Can not build V on Windows (x64)

Created on 24 Oct 2019  Â·  11Comments  Â·  Source: vlang/v

V version: latest git (f14425ec1829041deae5bcc4c9649126ea292f75)
OS: Windows x64.

What did you do?
screenshot
(I have VS2019 [full C++ workload] installed and MINGW64 and also Cygwin.)
But... Apparently there is something wrong.

What did you expect to see?
/

What did you see instead?
See the screenshot above.

Bug

Most helpful comment

From 0 on:
1, git clone --depth=1 https://github.com/vlang/v vlang # git.exe must be installed.
2, cd vlang; git clone --depth=1 https://github.com/vlang/vc
3, gcc -std=c99 -w -o vc.exe vc/v_win.c # mingw64 is needed.
4, ./vc.exe -o vv.exe v.v
5, ./vv.exe -prod -o v.exe v.v
The End.

All 11 comments

From Windows cmd

Building V
git version 2.23.0.windows.1
Downloading v.c...
Attempting to build v.c with GCC...
INFO: Could not find files for the given pattern(s).
Attempting to build v.c  with MSVC...
v_win.c
rebuild from source (twice, in case of C definitions changes)
'v3.exe' is not recognized as an internal or external command,
operable program or batch file.
V failed to build itself
Failed to compile - Create an issue at 'https://github.com/vlang' and tag '@emily33901'!
Exiting from error

From MSYS cmd

User@DESKTOP MINGW64 /f/v-lang
$ git rev-parse HEAD
f14425ec1829041deae5bcc4c9649126ea292f75

User@DESKTOP MINGW64 /f/v-lang
$ ./make.bat
Building V
git version 2.23.0
Downloading v.c...
Attempting to build v.c with GCC...
vc\v_win.c: In function ‘os__dir_exists’:
vc\v_win.c:6827:15: error: ‘INVALID_FILE_ATTRIBUTES’ undeclared (first use in this function)
 6827 |   if (attr == INVALID_FILE_ATTRIBUTES) {
      |               ^~~~~~~~~~~~~~~~~~~~~~~
vc\v_win.c:6827:15: note: each undeclared identifier is reported only once for each function it appears in
vc\v_win.c:6832:15: error: ‘FILE_ATTRIBUTE_DIRECTORY’ undeclared (first use in this function)
 6832 |   if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) {
      |               ^~~~~~~~~~~~~~~~~~~~~~~~
gcc failed to compile - Create an issue at 'https://github.com/vlang'

@emily33901 See above.

only v up.

only v up.

I can't compile v...

'v' is not recognized as an internal or external command, operable program or batch file.

What do you mean ?

From 0 on:
1, git clone --depth=1 https://github.com/vlang/v vlang # git.exe must be installed.
2, cd vlang; git clone --depth=1 https://github.com/vlang/vc
3, gcc -std=c99 -w -o vc.exe vc/v_win.c # mingw64 is needed.
4, ./vc.exe -o vv.exe v.v
5, ./vv.exe -prod -o v.exe v.v
The End.

From 0 on:
1, git clone --depth=1 https://github.com/vlang/v vlang # git.exe must be installed.
2, cd vlang; git clone --depth=1 https://github.com/vlang/vc
3, gcc -std=c99 -w -o vc.exe vc/v_win.c # mingw64 is needed.
4, ./vc.exe -o vv.exe v.v
5, ./vv.exe -prod -o v.exe v.v
The End.

Thank you! These instructions worked flawlessly.
Somebody please update the make.bat to reflect these commands.

I'm pretty sure that's what make.bat is doing, I'll have a look.

Thanks

I've noticed that LLVM is building win-binaries without the .exe file-name extension - thus make.bat will build a v and 'v up' will build a vup utility which cannot be executed until renemed

@gslicer I've noticed that it is llvm-mingw issue only, gcc and msvc add .exe automatically, maybe we need to raise issue in llvm-mingw project

Besides that mingw issue, I have the same problem as the thread opener and at the time I was executing the Make.bat I had not even mingw installed. So all was going over visual studio.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jtkirkpatrick picture jtkirkpatrick  Â·  3Comments

markgraydev picture markgraydev  Â·  3Comments

PavelVozenilek picture PavelVozenilek  Â·  3Comments

ArcDrake picture ArcDrake  Â·  3Comments

penguindark picture penguindark  Â·  3Comments