title: How build headless example browser from chromium source?
body: <p>I'm trying build headless example as C++ library from chromium srource </p>
  
  <pre><code>https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md#usage-as-a-c_library
  </code></pre>
  
  <pre><code>G:\chromium\src\headless&gt;gn gen  --args=is_debug=true --root=../ ../out/test
  Done. Made 10741 targets from 1804 files in 21901ms
  G:\chromium\src\headless&gt;ninja -C ../out/test headless_example
  ninja: Entering directory `../out/test'
  [24577/24577] LINK headless_example.exe headless_example.exe.pdb
  
  G:\chromium\src\headless&gt;
  </code></pre>
  
  <p>Aftre build, i'm trying start headless_example.exe and i'm getting error</p>
  
  <pre><code>G:\chromium\src\out\test&gt;headless_example.exe
  [0121/145957.684:FATAL:command_line.cc(234)] Check failed: current_process_comma
  ndline_.
  Backtrace:
          base::debug::StackTrace::StackTrace [0x000007FEDF41AF29+105] (G:\chromiu
  m\src\base\debug\stack_trace_win.cc:281)
          base::debug::StackTrace::StackTrace [0x000007FEDF419EC5+37] (G:\chromium
  \src\base\debug\stack_trace.cc:203)
          logging::LogMessage::~LogMessage [0x000007FEDF46BA86+134] (G:\chromium\s
  rc\base\logging.cc:591)
          base::CommandLine::ForCurrentProcess [0x000007FEDF3CE65B+155] (G:\chromi
  um\src\base\command_line.cc:235)
          headless::HeadlessBrowserMain [0x000007FED0F3DEDC+332] (G:\chromium\src\
  headless\lib\browser\headless_browser_impl.cc:284)
          main [0x000000013FA225F1+257] (G:\chromium\src\headless\app\headless_exa
  mple.cc:195)
          invoke_main [0x00000001402F0804+52] (f:\dd\vctools\crt\vcstartup\src\sta
  rtup\exe_common.inl:79)
          __scrt_common_main_seh [0x00000001402F093E+302] (f:\dd\vctools\crt\vcsta
  rtup\src\startup\exe_common.inl:288)
          __scrt_common_main [0x00000001402F09BE+14] (f:\dd\vctools\crt\vcstartup\
  src\startup\exe_common.inl:331)
          mainCRTStartup [0x00000001402F09D9+9] (f:\dd\vctools\crt\vcstartup\src\s
  tartup\exe_main.cpp:17)
          BaseThreadInitThunk [0x0000000077BB59CD+13]
          RtlUserThreadStart [0x0000000077D1385D+29]
  
  </code></pre>
  
  <p>How build and run headless_example  ? </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>My steps</p>
  
  <ol>
  <li>gn gen --ide=vs2017 --filters="//headless" out\Headless</li>
  <li>ninja -C out\Headless headless_example</li>
  </ol>
  
  <p><strong>After building 6 hours</strong> </p>
  
  <ol start="3">
  <li>cd out/Headless</li>
  <li>./headless_example.exe</li>
  </ol>
  
  <p>And i getting same error.</p>
  
  <p>But i success build and run chromedriver</p>
  
  <p>My Debug/args.gn</p>
  
  <p>./out/Debug/args.gn</p>
  
  <pre><code># GN args template for the Headless Chrome library
  #
  # Add import to arg.gn in out directory and run gn gen on the directory to use.
  # E.g. for out directory out/foo:
  # echo 'import("//build/args/headless.gn")' &gt; out/foo/args.gn
  # gn gen out/foo
  #
  # Use gn args to add your own build preference args.
  
  use_ozone = true
  ozone_auto_platforms = false
  ozone_platform = "headless"
  ozone_platform_headless = true
  
  # Embed resource.pak into binary to simplify deployment.
  headless_use_embedded_resources = true
  
  # Expose headless bindings for freetype library bundled with Chromium.
  headless_fontconfig_utils = true
  
  # Remove a dependency on a system fontconfig library.
  use_bundled_fontconfig = true
  
  # In order to simplify deployment we build ICU data file
  # into binary.
  icu_use_data_file = false
  
  # Use embedded data instead external files for headless in order
  # to simplify deployment.
  v8_use_external_startup_data = false
  
  enable_nacl = false
  enable_print_preview = false
  enable_remoting = false
  use_alsa = false
  use_cups = false
  use_dbus = false
  use_gio = false
  use_kerberos = false
  use_libpci = false
  use_pulseaudio = false
  use_udev = false
  rtc_use_pipewire = false
  </code></pre>