3

Why is bazel still using -std=c++0x when I explicitly passed something else? Not using passed arguments

Blub
  • 13,014
  • 18
  • 75
  • 102
  • Possible duplicate of [how to set c++ standard version when build with bazel?](https://stackoverflow.com/questions/40260242/how-to-set-c-standard-version-when-build-with-bazel) – Unapiedra Dec 09 '18 at 10:08

1 Answers1

0

Linkopts are options given to the linker: https://docs.bazel.build/versions/master/be/c-cpp.html#cc_binary.linkopts

Have a look at this duplicate answer: https://stackoverflow.com/a/43388168/461597

For single executables you can use copts.

Unapiedra
  • 15,037
  • 12
  • 64
  • 93
  • 1
    as you can see from the attached picture I'm already using copts and it isnt working. (this is a cc_library by the way) – Blub Dec 09 '18 at 10:26
  • 1
    It can't be seen in partial screenshot, but when using `copts`, `-std=c++14` should be passed after `-std=c++0x` on the command-line, overriding the default setting. I observed this behavior with Bazel 0.21. If `copts` isn't working, could you post the full command-line from `bazel build -s`? – Rodrigo Queiro Jan 14 '19 at 19:11