V version: V 0.1.29 ce4ee2b
OS: Ubuntu 20.04.1 LTS
What did you do?
I downloaded V from the V website, and tried v run hw.v, which contained
fn main() {
println("Hello, world!")
}
What did you expect to see?
I expected to see "Hello, world!"
What did you see instead?
==================
tcc: error: file 'crt1.o' not found
tcc: error: file 'crti.o' not found
/tmp/v/hw.tmp.c:64: error: include file 'inttypes.h' not found
...
==================
(Use `v -cg` to print the entire error message)
builder error:
==================
C error. This should never happen.
If you were not working with C interop, please raise an issue on GitHub:
https://github.com/vlang/v/issues/new/choose
You can also use #help on Discord: https://discord.gg/vlang
Looks like you downloaded the "release" zip. Please try v up, and if that doesn't update your V, clone the repo and build it fresh.
I ran make and got
make fresh_vc
make[1]: Entering directory '/home/njb/v'
git clone --depth 1 --quiet https://github.com/vlang/vc ./vc
make[1]: Leaving directory '/home/njb/v'
cd ./vc && git clean -xf && git pull --quiet
make fresh_tcc
make[1]: Entering directory '/home/njb/v'
rm -rf /var/tmp/tcc
git clone --depth 1 --quiet https://github.com/vlang/tccbin /var/tmp/tcc
make[1]: Leaving directory '/home/njb/v'
cd /var/tmp/tcc && git clean -xf && git pull --quiet
cc -g -std=gnu99 -w -o ./v ./vc/v.c -lm -lpthread
tcc: error: file 'crt1.o' not found
tcc: error: file 'crti.o' not found
./vc/v.c:222: error: include file 'inttypes.h' not found
make: *** [Makefile:57: all] Error 1
It appears this is a problem caused by tcc and not V itself, by using gcc I am able to compile and use V successfully.
It is likely that V is picking up the system installed version of tcc, which is _very_ old. You can run the newer version (which V brings down for you) by adding -cc /var/tmp/tcc/bin/tcc to the v command line.
Hmm, I did that and get
cd ./vc && git clean -xf && git pull --quiet
cd /var/tmp/tcc && git clean -xf && git pull --quiet
cc -g -std=gnu99 -w -o ./v ./vc/v.c -lm -lpthread
tcc: error: file 'crt1.o' not found
tcc: error: file 'crti.o' not found
In file included from ./vc/v.c:222:
./vc/v.c:222: error: include file 'inttypes.h' not found
You may have to install build-essentials on your distro.
On Ubuntu this is
sudo apt install build-essentials
Thanks! After I installed build-essentials I had no more problems :)