On Wed, 2016-07-27 at 21:39 +0800, Lei Zhang wrote: > The problem is, somehow Make defaults CXX to g++ instead of c++, so > my solution doesn't work. While CC already defaults to cc, is there > any specific reason for CXX not to default to c++?
The POSIX spec defines that "cc" be a C compiler, and that the CC make macro be set to it (actually the newer POSIX specs require it be set to "c99"; that should be fixed in GNU make). There's no requirement for a C++ compiler on a POSIX system, and no default setting for the CXX variable (in fact that variable isn't defined in POSIX). So, make just uses "g++" by default. I seem to recall that back in the early days of GCC, there was no "c++" installed and only "g++". If you want a specific C++ compiler, you should set CXX to that value. _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make