I try to globally set header properties for C++ source examples, with no success. I would have expected that the following works

 #+PROPERTY: header-args:C++ :var x=1.0

What did work is using general header args property:

 #+PROPERTY: header-args :var x=1.1

Also specific property drawer worked:

* Resources
:header-args:C++: :var x=1.2

And of course using plain old header arguments works:

#+header: :exports results
#+header: :includes <iostream>
#+header: :var x=1.3
#+begin_src C++
std::cout << x;

Could that be a bug or am I doing something wrong?


I found out, that I have to use cpp instead of C++ to get it working:

#+PROPERTY: header-args:cpp :var x=1.0

#+header: :exports results
#+header: :includes <iostream>
#+begin_src cpp
std::cout << x;

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.