From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QBkjJCBT8V54RQAA0tVLHw (envelope-from ) for ; Tue, 23 Jun 2020 00:56:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id uJUjICBT8V7oKQAAB5/wlQ (envelope-from ) for ; Tue, 23 Jun 2020 00:56:00 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EF44D9400C1 for ; Tue, 23 Jun 2020 00:55:59 +0000 (UTC) Received: from localhost ([::1]:53522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnXED-0007Km-7F for larch@yhetil.org; Mon, 22 Jun 2020 20:55:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnXDp-0007Kc-J2 for emacs-orgmode@gnu.org; Mon, 22 Jun 2020 20:55:33 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:44963) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnXDk-00054h-FS for emacs-orgmode@gnu.org; Mon, 22 Jun 2020 20:55:33 -0400 Received: by mail-ej1-x62f.google.com with SMTP id ga4so6302519ejb.11 for ; Mon, 22 Jun 2020 17:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=OMPRXkI++HkoYvU9BZaIobYAv/8r0l26Z67/mmNsyno=; b=g+dxZbb/+tmYX/tlYqiwgPoshD4OUb+vTgM9s2WXCYSvwpA2UUBy//zkiHQNzV5prz nHctJ/Fu0HDR0EnhqWJF4jlrEi+9yuNQUeM7ACdNS1N4hhPLR3OAxT68qPhHuRuM0+Eu qcfGPkTIS/FpPugx+PXUaA4M2ywC22b47UaGgPik4e96lM6SPq4uzKCFJkpj4Ke7WSjZ Gopd/0/wdFpgCUvvQguwgkWez4qh9SozpIcWPJ4b30cm3Og2lxL7AvA7YH6MoLfHqaaf +V9mVWMxZlDgKZWXPYgdsmeAZ3btJxJfaea1G+GIyNXOTAcdqDSiVH23LM1bvaEQPbty UP8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=OMPRXkI++HkoYvU9BZaIobYAv/8r0l26Z67/mmNsyno=; b=GaGShpxJE6scIV/t0cALVuhIsCJd/Gdf025iitYUseFDENXmoGybynGBPjjN6+inlJ rwtM92Mfip+8gL4GHbCSmBSDHHexqa4ENGdUzAHNRI4r/0K9jQWKpm5cMJ1ipzA1Ypc0 k6kDmc0bCWXLZV/f9DMpo0X3fAbqTGlLoDz/D+CbSkgYyrLpWCKisoRPYUdr2UP6u+G7 BvfoyH0ZmaBNG1juv/UrmlLyAXv/ejae3uoCA5rl+/VyBM70IFf83xQ436h+9iAJKi8j LEBCMlIP5n1/oRMC2PrJbMxuR19mgD4L9406aEfTrsUOe7LaXrhulfXNKGe/MrKfgiTu gj0g== X-Gm-Message-State: AOAM531bo+HH5ED8p4b4QFjPcF5QLWpCkqx1Ytml3wxq65fBDWjco0AE x3FdEXwos02aZjQ82g420zTtkcUJrrYWpfiQTRC8Wl9Z X-Google-Smtp-Source: ABdhPJzxQcwjG/iM7nrJl3MBSxWGbjZdOVcHglqfB0SqCcb7wLlfRDCXP2w1/DKa+5dL+LtAqg5SZpAklFgVswtBD1A= X-Received: by 2002:a17:906:53d4:: with SMTP id p20mr5455070ejo.472.1592873726043; Mon, 22 Jun 2020 17:55:26 -0700 (PDT) MIME-Version: 1.0 From: Naoya Yamashita Date: Tue, 23 Jun 2020 09:54:52 +0900 Message-ID: Subject: Not working ob-C sample code To: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="0000000000009ce8b105a8b5d077" Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=conao3@gmail.com; helo=mail-ej1-x62f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=g+dxZbb/; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.71 X-TUID: ACU8fAtD03m6 --0000000000009ce8b105a8b5d077 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi! I'm Naoya. This is the first mail to this ML. First, thank you for developing such awesome packages! I found ob-C sample[1] is not working for me, I report that to this ML. [1]: https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-C.org.html ## Repro step 1. Require org and ob-C. 2. Write below in some org buffer. ```org #+tblname: somedata | nb | sqr | noise | |-------+-----+-------| | zero | 0 | 0.23 | | one | 1 | 1.31 | | two | 4 | 4.61 | | three | 9 | 9.05 | | four | 16 | 16.55 | #+name: c-table #+header: :exports results #+begin_src C++ :var somedata=3Dsomedata int main() { for (int i=3D0; i=E2=80=99; did you forget to =E2=80=98#include = =E2=80=99? +++ |+#include 1 | /tmp/babel-kMPbac/C-src-KDQDdx.cpp: In function =E2=80=98int main()=E2=80= =99: /tmp/babel-kMPbac/C-src-KDQDdx.cpp:27:5: error: =E2=80=98printf=E2=80=99 wa= s not declared in this scope 27 | printf ("%2d %7s ", i, somedata_h(i,"nb")); | ^~~~~~ /tmp/babel-kMPbac/C-src-KDQDdx.cpp:1:1: note: =E2=80=98printf=E2=80=99 is d= efined in header =E2=80=98=E2=80=99; did you forget to =E2=80=98#include =E2= =80=99? +++ |+#include 1 | /tmp/babel-kMPbac/C-src-KDQDdx.cpp:30:38: error: =E2=80=98atof=E2=80=99 was= not declared in this scope 30 | printf ("%5s %5g ", cell, 1000*atof(cell)); | ^~~~ zsh:1: permission denied: /tmp/babel-kMPbac/C-bin-EfCzWt ``` ## Some note - These errors caused because a lack to include some library. - Add some include statement generate and insert it in `org-babel-C-utility-header-to-C`? - Add new option for a user preamble and insert it in `org-babel-C-expand-C`? Regards, --0000000000009ce8b105a8b5d077 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi! I'm Naoya. This is the first mail to this ML.
=
First, thank you for developing=C2=A0such awesome packages!<= /div>

I found ob-C=C2=A0sample[1] is not working for me,= I report that to this ML.

=

## Repro step
1. Require org and ob-C.
<= div>2. Write below in some org buffer.
```org
#+tblname= : somedata
| nb =C2=A0 =C2=A0| sqr | noise |
|-------+-----+-------|<= br>| zero =C2=A0| =C2=A0 0 | =C2=A00.23 |
| one =C2=A0 | =C2=A0 1 | =C2= =A01.31 |
| two =C2=A0 | =C2=A0 4 | =C2=A04.61 |
| three | =C2=A0 9 |= =C2=A09.05 |
| four =C2=A0| =C2=A016 | 16.55 |

#+name: c-table#+header: :exports results
#+begin_src C++ :var somedata=3Dsomedata=C2=A0 int main()
=C2=A0 {
=C2=A0 =C2=A0 for (int i=3D0; i<someda= ta_rows; i++) {
=C2=A0 =C2=A0 =C2=A0 printf ("%2d %7s ", i, so= medata_h(i,"nb"));
=C2=A0 =C2=A0 =C2=A0 for (int j=3D1; j<s= omedata_cols; j++) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 const char* cell =3D so= medata[i][j];
=C2=A0 =C2=A0 =C2=A0 =C2=A0 printf ("%5s %5g ", = cell, 1000*atof(cell));
=C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 p= rintf("\n");
=C2=A0 =C2=A0 }
=C2=A0 =C2=A0 return 0;
=C2= =A0 }
#+end_src
```
3. Babel src block via C-c C= -c.
4. Error occurred.=C2=A0 I get below error output
`= ``
/tmp/babel-kMPbac/C-src-KDQDdx.cpp: In function =E2=80=98int g= et_column_num(int, const char**, const char*)=E2=80=99:
/tmp/babel-kMPba= c/C-src-KDQDdx.cpp:17:9: error: =E2=80=98strcmp=E2=80=99 was not declared i= n this scope
=C2=A0 =C2=A017 | =C2=A0 =C2=A0 if (strcmp(header[c],column= )=3D=3D0)
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~
/= tmp/babel-kMPbac/C-src-KDQDdx.cpp:1:1: note: =E2=80=98strcmp=E2=80=99 is de= fined in header =E2=80=98<cstring>=E2=80=99; did you forget to =E2=80= =98#include <cstring>=E2=80=99?
=C2=A0 +++ |+#include <cstring&= gt;
=C2=A0 =C2=A0 1 |
/tmp/babel-kMPbac/C-src-KDQDdx.cpp: In functio= n =E2=80=98int main()=E2=80=99:
/tmp/babel-kMPbac/C-src-KDQDdx.cpp:27:5:= error: =E2=80=98printf=E2=80=99 was not declared in this scope
=C2=A0 = =C2=A027 | =C2=A0 =C2=A0 printf ("%2d %7s ", i, somedata_h(i,&quo= t;nb"));
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 ^~~~~~
/tmp/babel-= kMPbac/C-src-KDQDdx.cpp:1:1: note: =E2=80=98printf=E2=80=99 is defined in h= eader =E2=80=98<cstdio>=E2=80=99; did you forget to =E2=80=98#include= <cstdio>=E2=80=99?
=C2=A0 +++ |+#include <cstdio>
=C2=A0= =C2=A0 1 |
/tmp/babel-kMPbac/C-src-KDQDdx.cpp:30:38: error: =E2=80=98a= tof=E2=80=99 was not declared in this scope
=C2=A0 =C2=A030 | =C2=A0 =C2= =A0 =C2=A0 printf ("%5s %5g ", cell, 1000*atof(cell));
=C2=A0 = =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~= ~~
zsh:1: permission denied: /tmp/babel-kMPbac/C-bin-EfCzWt
```

## Some note
- These errors caused= because a lack to include=C2=A0some library.
=C2=A0 - Add some i= nclude statement generate and insert it in `org-babel-C-utility-header-to-C= `?
=C2=A0 - Add new option for a user preamble and insert it in `= org-babel-C-expand-C`?

Regards,
--0000000000009ce8b105a8b5d077--