Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter namespace error #148

Closed
master308 opened this issue May 31, 2017 · 1 comment
Closed

Jupyter namespace error #148

master308 opened this issue May 31, 2017 · 1 comment

Comments

@master308
Copy link

When using Jupyter with cling error occurs when using namespace std; is omitted. Following example works when cling is run from terminal, but not in Jupyter:

#include<iostream>
std::cout<<"Hallo world!!"<<endl;

corresponding error in Jupyter is:

In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:38:
In file included from /usr/include/c++/5/iosfwd:39:
In file included from /usr/include/c++/5/bits/stringfwd.h:40:
/usr/include/c++/5/bits/memoryfwd.h:51:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:38:
In file included from /usr/include/c++/5/iosfwd:39:
/usr/include/c++/5/bits/stringfwd.h:43:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:38:
In file included from /usr/include/c++/5/iosfwd:40:
In file included from /usr/include/c++/5/bits/postypes.h:40:
In file included from /usr/include/c++/5/cwchar:44:
/usr/include/wchar.h:132:1: error: expected unqualified-id
__BEGIN_DECLS
^
/usr/include/x86_64-linux-gnu/sys/cdefs.h:98:31: note: expanded from macro '__BEGIN_DECLS'
# define __BEGIN_DECLS  extern "C" {
                               ^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:38:
In file included from /usr/include/c++/5/iosfwd:40:
In file included from /usr/include/c++/5/bits/postypes.h:40:
/usr/include/c++/5/cwchar:63:1: error: namespaces can only be defined in global or namespace scope
{
^
/usr/include/c++/5/cwchar:136:1: error: namespaces can only be defined in global or namespace scope
{
^
/usr/include/c++/5/cwchar:242:1: error: namespaces can only be defined in global or namespace scope
{
^
/usr/include/c++/5/cwchar:263:1: error: namespaces can only be defined in global or namespace scope
{
^
/usr/include/c++/5/cwchar:278:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:38:
In file included from /usr/include/c++/5/iosfwd:40:
/usr/include/c++/5/bits/postypes.h:69:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:38:
/usr/include/c++/5/iosfwd:43:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:40:
In file included from /usr/include/c++/5/bits/char_traits.h:39:
In file included from /usr/include/c++/5/bits/stl_algobase.h:60:
/usr/include/c++/5/bits/functexcept.h:43:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:40:
In file included from /usr/include/c++/5/bits/char_traits.h:39:
In file included from /usr/include/c++/5/bits/stl_algobase.h:61:
/usr/include/c++/5/bits/cpp_type_traits.h:69:1: error: namespaces can only be defined in global or namespace scope
{
^
/usr/include/c++/5/bits/cpp_type_traits.h:79:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:40:
In file included from /usr/include/c++/5/bits/char_traits.h:39:
In file included from /usr/include/c++/5/bits/stl_algobase.h:62:
/usr/include/c++/5/ext/type_traits.h:38:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:40:
In file included from /usr/include/c++/5/bits/char_traits.h:39:
In file included from /usr/include/c++/5/bits/stl_algobase.h:63:
/usr/include/c++/5/ext/numeric_traits.h:38:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:40:
In file included from /usr/include/c++/5/bits/char_traits.h:39:
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:
In file included from /usr/include/c++/5/bits/stl_pair.h:59:
/usr/include/c++/5/bits/move.h:37:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:40:
In file included from /usr/include/c++/5/bits/char_traits.h:39:
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:
In file included from /usr/include/c++/5/bits/stl_pair.h:59:
In file included from /usr/include/c++/5/bits/move.h:57:
/usr/include/c++/5/type_traits:43:1: error: namespaces can only be defined in global or namespace scope
{
^
/usr/include/c++/5/type_traits:53:1: error: namespaces can only be defined in global or namespace scope
{
^
In file included from input_line_3:2:
In file included from /usr/include/c++/5/iostream:39:
In file included from /usr/include/c++/5/ostream:38:
In file included from /usr/include/c++/5/ios:40:
In file included from /usr/include/c++/5/bits/char_traits.h:39:
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:
In file included from /usr/include/c++/5/bits/stl_pair.h:59:
/usr/include/c++/5/bits/move.h:60:1: error: namespaces can only be defined in global or namespace scope
{
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

​
@vgvassilev
Copy link
Owner

I believe this is a limitation on the Jupyter implementation. You probably need to separate this in two different cells.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants