vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.88k stars 2.17k forks source link

compiler error #488

Closed xywf221 closed 5 years ago

xywf221 commented 5 years ago

I installed the compilation v on readme, but his process seemed to be wrong


mac-mini-Macintosh-/v/compiler-master-make-✔-19364-09:41:16
wget https://vlang.io/v.c
--2019-06-24 09:41:25 -- https://vlang.io/v.c Resolving host vlang.io (vlang.io)...
3.91.188.13 Connecting vlang.io (vlang.io) s3.91.188.13?443...
Connected. HTTP request has been made and is waiting for a response...
200 OK
Length: 317523 (310K) (app/octet-stream)

Saving to: "v.c"

v.c 100% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2019-06-24 09:41:27 (380 KB/s) - Saved "v.c" (317523/317523)
cc -std-c11 -w -o vc v.c
.vc -o v .
errno?2 err?'No such file or directory'
V panic: /Users/mac-mini/code/v//os doesnt exist
make: svError 1 ```
xywf221 commented 5 years ago

Ok, I am reading the source code of v.c and found that this error should be in line 7512.

String lang_dir = string_add(os__home_dir(), tos2("/code/v/"));

It seems to use an absolute path, I will try to change it to a relative path

tonylinyy commented 5 years ago

code directory has to be used (it's a temporary limitation) you put the v source code to ~/code ?

xywf221 commented 5 years ago

Yes I've re-re-edited the clone subcode under the ''-/code' but it's also compilation without success

xywf221 commented 5 years ago

Error message

ld: library not found for -lcrt1.10.6.o
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
V panic: clang error
make: svError 1 

I know through Search Google that it should be using old or unsupported compilation options. I printed out the command line that performed the compilation by modifying the source code.

/usr/local/cellar/llvm/8.0.0/bin/clang -I. -w -g -o v -mmacosx-version-min-10.7 -x objective-c /Users/mac-mini/.vlang0.12//v.c

I tried to change him to

/usr/local/cellar/llvm/8.0.0/bin/clang -I. -w -g -o v /Users/mac-mini//.vlang0.0.12//v.c

It's compiled smoothly.

whoizit commented 5 years ago

cc -std-c11 -w -o vc v.c

missing equal symbol, should be cc -std=gnu11 -w -o vc v.c anyway you should reclone it and try it again with make command. Don't forget about ~/code/v

https://github.com/vlang/v#installing-v-from-source

Bowero commented 5 years ago

This is no longer the case.