Whenever I try to compile this code it always ends up with this error:
In file included from /usr/include/wchar.h:6:0, from /usr/lib/gcc/i68
The error is because your gcc-core package and gcc-g++ are not of the same version. Either downgrade one of them to solve the problem or update both the libraries. Updating both the libraries is the recommended way.