From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: Capturing output from C/C++ Date: Thu, 05 Mar 2015 19:06:46 +0100 Message-ID: <54F89B36.1050708@free.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTaAe-0000Zf-Q4 for emacs-orgmode@gnu.org; Thu, 05 Mar 2015 13:06:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTaAb-0001oD-Il for emacs-orgmode@gnu.org; Thu, 05 Mar 2015 13:06:52 -0500 Received: from smtp3-g21.free.fr ([212.27.42.3]:17648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTaAb-0001o3-D9 for emacs-orgmode@gnu.org; Thu, 05 Mar 2015 13:06:49 -0500 Received: from [IPv6:2a01:e35:2e21:def0:bdda:cf35:1b7a:c99f] (unknown [IPv6:2a01:e35:2e21:def0:bdda:cf35:1b7a:c99f]) by smtp3-g21.free.fr (Postfix) with ESMTP id E93BEA637E for ; Thu, 5 Mar 2015 19:06:12 +0100 (CET) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org It might be due to the return 1; statement. Change it to return 0; and try again. Le 05/03/2015 17:27, Roger Mason a =E9crit : > Hello, > > I have a short C++ program: > > #+BEGIN_SRC cpp :flags -lm :results output > #include > #include > #include // for ceil > #include // for atof > > double f (double fv, double o, int i) { > return fv / 2.0 + (1.0 - o) * fv * i; > } > > int num (double d, double fv, double o) { > return (int)ceil( d / ((1.0 - o) * fv )); > } > > int main (int argc, char* argv[]) { > if ( argc < 6 ) { > std::cout << "Usage:\n" << std::endl; > std::cout << "grid w fovx ox h fovy oy\n" << std::endl; > return 1; > } > ... > #+END_SRC > > that outputs some data to stdout. > > So far I have not been able to capture the output of the program back > into to my org buffer. > > Is that possible and, if so, how? > > Thanks, > Roger > Org-mode version 8.2.6 > >