vlang

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 ??


Solution

    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.1). it would flow compilation error rightnow. Hope will improve it later.