import std.core;
int main()
{
std::cout << "Hello World!\n";
}
如果我从命令行编译这段代码,使用
cl /c /O2 /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /EHsc /MD /std:c++latest /Gd /TP /experimental:module /ifcSearchDir "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29304\ifc\x64\Release" ConsoleApplication1.cpp
它可以很好地编译和链接。
如果我使用 IDE 和相同的选项编译相同的代码,输出窗口会显示此结果。
1>cl /c /O2 /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /EHsc /MD /std:c++latest /Gd /TP /experimental:module /ifcSearchDir "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29304\ifc\x64\Release" ConsoleApplication1.cpp
1>ConsoleApplication1.cpp
1>ConsoleApplication1.cpp(1): fatal error C1011: cannot locate standard module interface. Did you install the library part of the C++ modules feature in VS setup?
1>Done building project "ConsoleApplication1.vcxproj" -- FAILED.
谁能启发我这里发生了什么?我忘记了什么?