fatal error: bits/wchar.h: No such file or directory #include <bits/wchar.h>

560 views
Skip to first unread message

Faiz Satria

unread,
Aug 28, 2016, 10:44:53 AM8/28/16
to ns-3-users
Hi all,
my name is faiz. I am doing my last project at University
I want to running ./waf and got like this... somebody can help me please :(


./waf
Waf: Entering directory `/home/faiz/ns-allinone-3.25/ns-3.25/build'
[ 827/1705] Compiling scratch/leach.cc
[ 828/1705] Compiling scratch/subdir/scratch-simulator-subdir.cc
[ 829/1705] Compiling scratch/test.cc
In file included from /usr/include/c++/4.8/cwchar:44:0,
                 from /usr/include/c++/4.8/bits/postypes.h:40,
                 from /usr/include/c++/4.8/iosfwd:40,
                 from /usr/include/c++/4.8/ios:38,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from ./ns3/fatal-error.h:24,
                 from ./ns3/abort.h:24,
                 from ./ns3/core-module.h:10,
                 from ../scratch/subdir/scratch-simulator-subdir.cc:17:
/usr/include/wchar.h:32:2: error: #error Attempted to include wchar.h when uClibc built without wide char support.
 #error Attempted to include wchar.h when uClibc built without wide char support.
  ^
In file included from /usr/include/c++/4.8/cwchar:44:0,
                 from /usr/include/c++/4.8/bits/postypes.h:40,
                 from /usr/include/c++/4.8/iosfwd:40,
                 from /usr/include/c++/4.8/ios:38,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from ./ns3/fatal-error.h:24,
                 from ./ns3/abort.h:24,
                 from ./ns3/core-module.h:10,
                 from ../scratch/subdir/scratch-simulator-subdir.cc:17:
/usr/include/wchar.h:54:24: fatal error: bits/wchar.h: No such file or directory
 #include <bits/wchar.h>
                        ^
compilation terminated.

[ 830/1705] Compiling scratch/leach_10.cc
[ 831/1705] Compiling scratch/scratch-simulator.cc
In file included from /usr/include/c++/4.8/cwchar:44:0,
                 from /usr/include/c++/4.8/bits/postypes.h:40,
                 from /usr/include/c++/4.8/bits/char_traits.h:40,
                 from /usr/include/c++/4.8/string:40,
                 from ./ns3/animation-interface.h:26,
                 from ./ns3/netanim-module.h:10,
                 from ../scratch/leach.cc:2:
/usr/include/wchar.h:32:2: error: #error Attempted to include wchar.h when uClibc built without wide char support.
 #error Attempted to include wchar.h when uClibc built without wide char support.
  ^
In file included from /usr/include/c++/4.8/cwchar:44:0,
                 from /usr/include/c++/4.8/bits/postypes.h:40,
                 from /usr/include/c++/4.8/bits/char_traits.h:40,
                 from /usr/include/c++/4.8/string:40,
                 from ./ns3/animation-interface.h:26,
                 from ./ns3/netanim-module.h:10,
                 from ../scratch/leach.cc:2:
/usr/include/wchar.h:54:24: fatal error: bits/wchar.h: No such file or directory
 #include <bits/wchar.h>
                        ^
compilation terminated.

In file included from /usr/include/c++/4.8/cwchar:44:0,
                 from /usr/include/c++/4.8/bits/postypes.h:40,
                 from /usr/include/c++/4.8/iosfwd:40,
                 from /usr/include/c++/4.8/ios:38,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from ./ns3/fatal-error.h:24,
                 from ./ns3/abort.h:24,
                 from ./ns3/core-module.h:10,
                 from ../scratch/test.cc:1:
/usr/include/wchar.h:32:2: error: #error Attempted to include wchar.h when uClibc built without wide char support.
 #error Attempted to include wchar.h when uClibc built without wide char support.
  ^
In file included from /usr/include/c++/4.8/cwchar:44:0,
                 from /usr/include/c++/4.8/bits/postypes.h:40,
                 from /usr/include/c++/4.8/iosfwd:40,
                 from /usr/include/c++/4.8/ios:38,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from ./ns3/fatal-error.h:24,
                 from ./ns3/abort.h:24,
                 from ./ns3/core-module.h:10,
                 from ../scratch/test.cc:1:
/usr/include/wchar.h:54:24: fatal error: bits/wchar.h: No such file or directory
 #include <bits/wchar.h>
                        ^
compilation terminated.

In file included from /usr/include/c++/4.8/cwchar:44:0,
                 from /usr/include/c++/4.8/bits/postypes.h:40,
                 from /usr/include/c++/4.8/iosfwd:40,
                 from /usr/include/c++/4.8/ios:38,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from ./ns3/fatal-error.h:24,
                 from ./ns3/abort.h:24,
                 from ./ns3/core-module.h:10,
                 from ../scratch/scratch-simulator.cc:17:
/usr/include/wchar.h:32:2: error: #error Attempted to include wchar.h when uClibc built without wide char support.
 #error Attempted to include wchar.h when uClibc built without wide char support.
  ^
In file included from /usr/include/c++/4.8/cwchar:44:0,
                 from /usr/include/c++/4.8/bits/postypes.h:40,
                 from /usr/include/c++/4.8/iosfwd:40,
                 from /usr/include/c++/4.8/ios:38,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from ./ns3/fatal-error.h:24,
                 from ./ns3/abort.h:24,
                 from ./ns3/core-module.h:10,
                 from ../scratch/scratch-simulator.cc:17:
/usr/include/wchar.h:54:24: fatal error: bits/wchar.h: No such file or directory
 #include <bits/wchar.h>
                        ^
compilation terminated.

In file included from /usr/include/c++/4.8/cwchar:44:0,
                 from /usr/include/c++/4.8/bits/postypes.h:40,
                 from /usr/include/c++/4.8/bits/char_traits.h:40,
                 from /usr/include/c++/4.8/string:40,
                 from ./ns3/animation-interface.h:26,
                 from ./ns3/netanim-module.h:10,
                 from ../scratch/leach_10.cc:2:
/usr/include/wchar.h:32:2: error: #error Attempted to include wchar.h when uClibc built without wide char support.
 #error Attempted to include wchar.h when uClibc built without wide char support.
  ^
In file included from /usr/include/c++/4.8/cwchar:44:0,
                 from /usr/include/c++/4.8/bits/postypes.h:40,
                 from /usr/include/c++/4.8/bits/char_traits.h:40,
                 from /usr/include/c++/4.8/string:40,
                 from ./ns3/animation-interface.h:26,
                 from ./ns3/netanim-module.h:10,
                 from ../scratch/leach_10.cc:2:
/usr/include/wchar.h:54:24: fatal error: bits/wchar.h: No such file or directory
 #include <bits/wchar.h>
                        ^
compilation terminated.

Waf: Leaving directory `/home/faiz/ns-allinone-3.25/ns-3.25/build'
Build failed
 -> task in 'subdir' failed (exit status 1):
    {task 140626693879056: cxx scratch-simulator-subdir.cc -> scratch-simulator-subdir.cc.2.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/freetype2', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/harfbuzz', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_GSL=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../scratch/subdir/scratch-simulator-subdir.cc', '-c', '-o', '/home/faiz/ns-allinone-3.25/ns-3.25/build/scratch/subdir/scratch-simulator-subdir.cc.2.o']
 -> task in 'leach' failed (exit status 1):
    {task 140626693840784: cxx leach.cc -> leach.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/freetype2', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/harfbuzz', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_GSL=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../scratch/leach.cc', '-c', '-o', '/home/faiz/ns-allinone-3.25/ns-3.25/build/scratch/leach.cc.1.o']
 -> task in 'test' failed (exit status 1):
    {task 140626693880400: cxx test.cc -> test.cc.3.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/freetype2', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/harfbuzz', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_GSL=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../scratch/test.cc', '-c', '-o', '/home/faiz/ns-allinone-3.25/ns-3.25/build/scratch/test.cc.3.o']
 -> task in 'scratch-simulator' failed (exit status 1):
    {task 140626693899536: cxx scratch-simulator.cc -> scratch-simulator.cc.5.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/freetype2', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/harfbuzz', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_GSL=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../scratch/scratch-simulator.cc', '-c', '-o', '/home/faiz/ns-allinone-3.25/ns-3.25/build/scratch/scratch-simulator.cc.5.o']
 -> task in 'leach_10' failed (exit status 1):
    {task 140626693881744: cxx leach_10.cc -> leach_10.cc.4.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/freetype2', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/harfbuzz', '-I/usr/include/libxml2', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_GSL=1', '-DHAVE_SQLITE3=1', '-DHAVE_GTK2=1', '-DHAVE_LIBXML2=1', '../scratch/leach_10.cc', '-c', '-o', '/home/faiz/ns-allinone-3.25/ns-3.25/build/scratch/leach_10.cc.4.o']


Tommaso Pecorella

unread,
Aug 29, 2016, 4:01:20 AM8/29/16
to ns-3-users
Hi,

this is a "normal" C++ problem in finding system headers. Most probably you're missing a development package.
We can't know which one, but I think that you can safely google something like "missing bits/wchar.h **whatever OS you're using**".

HOWEVER, I am noticing that you're trying to compile a script named "leach.cc", and that the include is there.
Before using it, please triple check that it's not the one that did circulate on this group some times ago, as it has been already said multiple times that it's not to be used or trusted. It is *not* an ns-3 script (although it includes ns-3) and its results are highly questionable.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages