add the local directory to the library search path for C/C++ block compilation

* lisp/ob-C.el (org-babel-C-execute): Add the local directory to the
  library search path for C/C++ block compilation.

This patch was submitted to the list by Daimrod.
This commit is contained in:
Eric Schulte 2012-03-26 07:38:48 -04:00
parent 1ca7485a88
commit 4202665f5b

View file

@ -96,14 +96,15 @@ or `org-babel-execute:C++'."
(progn
(with-temp-file tmp-src-file (insert full-body))
(org-babel-eval
(format "%s -o %s %s %s"
(format "%s -o %s %s %s -I \"%s\""
(cond
((equal org-babel-c-variant 'c) org-babel-C-compiler)
((equal org-babel-c-variant 'cpp) org-babel-C++-compiler))
(org-babel-process-file-name tmp-bin-file)
(mapconcat 'identity
(if (listp flags) flags (list flags)) " ")
(org-babel-process-file-name tmp-src-file)) ""))))
(org-babel-process-file-name tmp-src-file)
(file-name-directory (buffer-file-name))) ""))))
((lambda (results)
(org-babel-reassemble-table
(if (member "vector" (cdr (assoc :result-params params)))