I can't get this code running in the newest version of MSVC. This code example is from the book called "Beginning C++20, From Novice to Professional" by Ivor Horton and Peter Van Weert.
import <iostream>;
int main()
{
int answer {42};
std::cout << "The answer to life, universe, and everything is "
<< answer
<< std::endl;
return 0;
}
I get this error:
could not find header unit for 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\iostream'
I am using Microsoft Visual Studio version 16.8.1, and have enabled these flags in project properties (according to the similar question Standard way of importing modules):
- /experimental:module
- /std:c++latest
- /EHsc
- /MD