V version:0.11
OS:windows 10
What did you do?
println('hello world')
What did you expect to see?
hello world
What did you see instead?
ATTR =16
ATTR =16
panic: string.v:642
expected type []int, but got int
It compiles & runs on my Win 10 machine but i get the ATTR=16 Stuff too.
I downloaded the latest clone and compiled v.c by mingw64
D:\v\examples>gcc --version
gcc (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
D:\v\examples>v --version
V 0.1.11
D:\v\examples>v run hello_world.v
ATTR =16
ATTR =16
============ running hello_world ============
Hello, World!
Windows 10.
I have the following message:
>>> println('hello world')
Looks like you are running V for the first time.
ATTR =-1
V repo not found. Go to https://vlang.io to download V.zip
or install V from source.
I am getting the same problem on Windows 10, v 0.1.12 built from a fresh source, although I could successfully build and run hello_world.v / log.v / life.v on 0.1.10.
The v REPL starts up and can be exited by 'exit', not with CTRLD+D.
Every println in the REPL quits the REPL with the message:
_Looks like you are running V for the first time.
V repo not found. Go to https://vlang.io to download V.zip
or install V from source._
This same message is also shown when trying to compile any program.
I don't understand this because I have a ~/.vlang/VROOT file. Does any one know a solution?
@Ivo-Balbaert where did you clone the repository to? Make sure there are no spaces in the path.
The REPL can be exited with Ctrl+C, I'll add that.
@Ivo-Balbaert there's a high chance you were using the v.zip. Cloning the repository with git clone will solve this problem
Yes thanks, CTRL+C works on Windows. I cloned the repo to c:\ , which created the v folder.
In a second attempt I first made a folder c:\vlang, and cloned into that. This worked in v 0.1.11.
Working with v 0.1.11 also created the /$HOME/.vlang folder, which contains a VROOT file; this contains the text: c:\vlang
@Ivo-Balbaert Ok, thanks. Removing $HOME/.vlang/VROOT file should help.
I'll fix this VROOT mess today.
Thanks, I removed VROOT: no difference, I removed .vlang folder and recompiled the source. When trying to compile or use the REPL, an empty .vlang folder is created, but the same message still appears:
c:\v\examples>v hello_world.v
Looks like you are running V for the first time.
V repo not found. Go to https://vlang.io to download V.zip
or install V from source.
c:\v\examples>v run hello_world.v
Looks like you are running V for the first time.
V repo not found. Go to https://vlang.io to download V.zip
or install V from source.
c:\v\examples>v
V 0.1.12
Use Ctrl-D or exit to exit
For now you have to use println() to print values, this will be fixed soon
println(7)
Looks like you are running V for the first time.
V repo not found. Go to https://vlang.io to download V.zip
or install V from source.
@Ivo-Balbaert I just fixed the last Windows bug. Can you please give it one last try?
Try the V.zip with the prebuilt binary: https://github.com/vlang/v/releases/download/v0.1.12/v.zip
No luck I'm afraid. I removed everything from previous installations. I tried V.zip, same result. I rebuilt V from source, same result. It's very strange, because it used to work for me.
Should there be anything in the .vlang folder? If I look at main.v around line 890, it seems to expect a file VROOT there, and a subfolder /vlib/builtin. However when I create an empty VROOT and copy vlib/builtin into .vlang, no improvement.
I think I found a bug in the code in main.v ( ):
if os.dir_exists(vroot) && os.dir_exists(vroot + '/vlib/builtin') {
tests for $HOME/vlang/VROOT as a directory, because in os.v the function dir_exists() is:
$if windows {
attr := int(C.GetFileAttributes(path.cstr()))
return attr == FILE_ATTRIBUTE_DIRECTORY
}
FILE_ATTRIBUTE_DIRECTORY only tests if it is a directory (https://docs.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants).
So lang_dir stays an empty string, that's why in line 899 I get this message.
However simply creating a VROOT subfolder in .vlang also does not work.
I also don't understand exactly what line 903 does: lang_dir = os.getwd() ; from the code in os.v line 541 it seems like it is simply filled with an empty string, which is why I get the rest of the message. I hope this is of some use.
v 0.1.13: same issue when trying to build the source in c:\v
However, after removing .vlang folder and building the source to e:\v, the "Looks like ..." message no longer appears.
v0.1.13, Win10, running from the Git for Windows Bash, exactly the same thing.
I checked with Process Monitor and there are strange things happening. Seems like V is searching for vlib in the CWD what doesn't really make sense. Also create a VROOT (why the capitals?) file didn't help.
No spaces in project dir. No spaces in V installation dir.
Fixed.