4

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
:PROPERTIES:
:header-args:C++: :var x=1.2
:END:

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;
#+end_src

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

1

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;
#+end_src
| improve this answer | |

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.