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 agree to our terms of service, privacy policy and cookie policy

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