configure: error: C++ preprocessor “/lib/cpp” fails sanity check

The following error occurred while installing TigerVnc for Ubuntu 10.04.3 LTS

checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.

This is due to the lack of appropriate libraries, so it can occur on different systems and when installing different software.
Since there is no corresponding library, the solution is simple and the corresponding library can be installed.
Here is one of the results I found. It reads as follows:
/lib/ CPP fails to solve puzzles check
When you run./configure, you’ll get an error:
Configure: error: C++ preprocessor “/lib/ CPP” fails sanity
check See ‘config.log’ for more details
Solution: this situation occurs because the relevant package of the c++ compiler is not installed. Log in as root and execute on the terminal:
# yum install glibc-headers
# yum install gcc-c++
This comrade USES the red hat version, for Ubuntu, just change yum to apt-get.
 
But I didn’t use this method myself, because Build-Essential contains a lot of base libraries, so I decided to give it a try and type

#sudo apt-get install build-essential

Run./configure again
This approach is recommended because it contains a number of basic libraries and may save you the trouble of missing libraries when you already have other software installed.

Read More: