简体   繁体   中英

How vlang compile static binary?

i have tried v -b native -prod hello.v but most modules are not supported.

// hello.v
println('Hello, World!')

How vlang compile static binary?

Updated:

i found another parameter -freestanding for static compile.

$ v -freestanding hello.v
$ file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped

it can compile hello.v sucessfully but it flow error with -prod flag: v -freestanding -prod hello.v

any good idea??

  1. according to https://github.com/vlang/v/blob/master/doc/docs.md , -freestanding force static build :

    v -freestanding hello.v

    v -freestanding -prod hello.v

  2. native Backend binaries would build static binary also.

    v -b native hello.v

    v -b native -prod hello.v

    v -b native -freestanding -prod hello.v

but, vlang is not mature enough, has too many bugs (ver 0.3.0). it would flow compilation error rightnow. Hope will improve it later.

Vlang comes with TCC, with the default setup. To do a normal compilation, you just need to do-

v filename.v

If you are using an alternate compiler, like say GCC, then it should be indicated. If you are getting errors, then you should show us what those errors are versus merely describing them, because others can't be sure what is really going on.

After we can see the actual image of the error, better help can be offered versus smearing the programming language or any false claims.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM