fuchsia/examples/intl/tz_version_parrot/main.cc uses fxl::CommandLineFromArgcArgv()
:
#include \"src/lib/fxl/command_line.h\"
...
int main(int argc,
In ./examples/hello_world/cpp/BUILD.gn
, extend the hello_world_cpp
module declaration with the fxl
dependency:
executable("bin") {
output_name = "hello_world_cpp"
sources = [ "hello_world.cc" ]
deps = [ "//src/lib/fxl" ] # Add this line
}
cd fuchsia
fx set bringup.x64 --with //examples/hello_world
fx build; fx qemu
...
hello_world_cpp
hello has_argv0():1
Reference: The same is done in other Fuchsia components that use fxl
(link).