fuchsia / examples / intl / tz_version_parrot / main. cc использует fxl::CommandLineFromArgcArgv()
:
#include "src/lib/fxl/command_line.h"
...
int main(int argc, const char** argv) {
const auto command_line = fxl::CommandLineFromArgcArgv(argc, argv);
Fuchsia> Руководства> рабочие процессы fx показывают использование fx set --with
:
$ fx set workstation.x64 --with //bundles:tests
Я изменил пример Hello World, чтобы использовать fxl::CommandLineFromArgcArgv()
:
~/fuchsia$ cat examples/hello_world/cpp/hello_world.cc
#include <iostream>
#include "src/lib/fxl/command_line.h"
int main(int argc_a, char** argv_a) {
auto command_line = fxl::CommandLineFromArgcArgv(argc_a, argv_a);
std::cout << "hello has_argv0():" << command_line.has_argv0() << "\n";
return 0;
}
~/fuchsia$ fx set bringup.x64 --with //examples/hello_world
ERROR at //examples/hello_world/cpp/hello_world.cc:2:11: Include not allowed.
#include "src/lib/fxl/command_line.h"
^-------------------------
It is not in any dependency of
//examples/hello_world/cpp:bin
The include file is in the target(s):
//src/lib/fxl:fxl
which should somehow be reachable.
, что приводит к ошибкам. Оригинал отлично работает:
~/fuchsia$ cat examples/hello_world/cpp/hello_world.cc
#include <iostream>
//#include "src/lib/fxl/command_line.h"
int main(int argc_a, char** argv_a) {
// auto command_line = fxl::CommandLineFromArgcArgv(argc_a, argv_a);
// std::cout << "hello has_argv0():" << command_line.has_argv0() << "\n";
return 0;
}
~/fuchsia$ fx set bringup.x64 --with //examples/hello_world
Generating JSON projects took 3090ms
Generating compile_commands took 219ms
Done. Made 26946 targets from 2635 files in 16354ms
Чего не хватает?