0

General Question here. Recently i was doing a school project and my code compiled on my PC but failed on the PC at my school because a header was missing. How is this possible when I used the same compiler (g++) and the same standard (C++17) form the same Makefile on both machines.

The header that was missing was <functional> used for std::function. On my PC i didn't need to include it I just called std::function and it worked.

5kobrat
  • 45
  • 9
  • What header was missing? Part of the standard library, some external library, your own one? – gerum Nov 30 '20 at 13:54
  • Does this answer your question? [How to determine which header files to include?](https://stackoverflow.com/questions/59070255/how-to-determine-which-header-files-to-include) – ChrisMM Dec 01 '20 at 15:14
  • Basically, the standard says that any header file may include any other header file. So neither compiler is wrong here. – ChrisMM Dec 01 '20 at 15:15

0 Answers0