Closed esquerbatua closed 5 years ago
Please use v build module constant/
as per this https://github.com/vlang/v/issues/1736#issuecomment-524615001
An update on the help could be helpfull though.
I'm closing this issue because v build module constant/
is working for code in issue.
Thank you @Henrixounez.
Sorry @Danil-Lapirow I get working using
v build module constant/
, but I get other time the error importing some library, like json or http
here is the code:
module constant
import json
import http
const (
URL = 'google.es'
)
struct Test {
name string
}
pub fn main() {
println(URL + '/')
test := Test{'one'}
println(test.name)
}
Sorry @Henrixounez if you can review the last comment, the error remains. Unless there is some other way to execute the compilation. Thank you!
Thanks @esquerbatua , indeed the way it worked was changed and v build constant/
didn't worked but v build constant
would have.
Sorry, but the error remains @Henrixounez @medvednikov
constant/const.v:8:1: redefinition of
constant.URL
Have you updated your v ?
Yes, and I get the same error with 'v build constant/' and 'v build constant', probably the error it's caused by the fix of the struct order?
I have copied your code and put in in ./constant/constant.v
then run v build constant
and have no errors.
@Henrixounez I think he has had a misunderstanding (sorry about that), you tested the code in the first comment, and that with v build constant
yes it works (now I edit the first comment so there are no misunderstanding errors).
The problem is when you put some import in the file, like in this comment
Yes, i have tested this one but have no problems.
A lot of thanks! All working.
V version: 0.1.18 OS: Ubuntu 18.04
What did you do? v -lib constant/
What did you expect to see? Compilation sucess
What did you see instead? /home/x/test/constant/const.v:5:1: redefinition of
constant.URL
Code:
Referenced issues: #749 #456