Re: [O] C++ code block not linked [SOLVED]

2017-11-29 Thread Roger Mason
Hello,

Nick Dokos  writes:

> All very good info, but why did the OP not have a g++?  Using a
> non-linux operating system? Using a non-GNU tool chain? Inquiring
> minds want to know...

Running on FreeBSD 10.3, which uses clang/clang++ by default.  That
said, I _do_ have gcc 5.4.0 installed and accessible as gcc/g++, so I
don't know why it did not work.

Cheers,
Roger



Re: [O] C++ code block not linked [SOLVED]

2017-11-28 Thread Nick Dokos
Thierry Banel  writes:

> On 28/11/2017 18:08, Roger Mason wrote:
>
> Hello,
> 
> Roger Mason  writes:
>
> It compiles fine:
> 
> c++ -std=c++11 -I/usr/local/include -L/usr/local/lib -lginac
> C-src-1053hn1.cpp
> 
> Solved by setting:
> 
> (setq org-babel-C++-compiler "c++")
> 
> I don't recall having had to do this before.
> 
> Phew! Very glad to have this working again.  I'm not aware of any other 
> tool
> that is as good as org-mode for literate programming and reproducible
> research.  A big thank you to those who created and maintain it.
> 
> Cheers,
> Roger
>
> Good to know it is solved.
> You can customize this variable:
>   C-h v org-babel-C++-compiler
>
> In case someone else bump into a similar problem, the actual command launched 
> by Babel can be obtained
> through the debugger:
>   M-x debug-on-entry RET org-babel-eval RET
>    evaluate the Babel block
> The debugger shows a line like this one:
>   * org-babel-eval("g++ -o /tmp/babel-3110Zeg/C-bin-3110Fwh -std=c++11 ...
> This works for many languages supported by Babel.
>

All very good info, but why did the OP not have a g++?  Using a
non-linux operating system? Using a non-GNU tool chain? Inquiring
minds want to know...

-- 
Nick




Re: [O] C++ code block not linked [SOLVED]

2017-11-28 Thread Thierry Banel

  
  
On 28/11/2017 18:08, Roger Mason wrote:


  Hello,

Roger Mason  writes:


  
It compiles fine:

c++ -std=c++11 -I/usr/local/include -L/usr/local/lib -lginac
C-src-1053hn1.cpp

  
  
Solved by setting:

(setq org-babel-C++-compiler "c++")

I don't recall having had to do this before.

Phew! Very glad to have this working again.  I'm not aware of any other tool
that is as good as org-mode for literate programming and reproducible
research.  A big thank you to those who created and maintain it.

Cheers,
Roger




Good to know it is solved.
You can customize this variable:
  C-h v org-babel-C++-compiler

In case someone else bump into a similar problem, the actual command
launched by Babel can be obtained through the debugger:
  M-x debug-on-entry RET org-babel-eval

RET
   evaluate the Babel block
The debugger shows a line like this one:
  * org-babel-eval("g++ -o /tmp/babel-3110Zeg/C-bin-3110Fwh
-std=c++11 ...
This works for many languages supported by Babel.


  




Re: [O] C++ code block not linked [SOLVED]

2017-11-28 Thread Roger Mason
Hello,

Roger Mason  writes:

> It compiles fine:
>
> c++ -std=c++11 -I/usr/local/include -L/usr/local/lib -lginac
> C-src-1053hn1.cpp

Solved by setting:

(setq org-babel-C++-compiler "c++")

I don't recall having had to do this before.

Phew! Very glad to have this working again.  I'm not aware of any other tool
that is as good as org-mode for literate programming and reproducible
research.  A big thank you to those who created and maintain it.

Cheers,
Roger