Problem with c++20 modules

Answered

Hi,

I would like to use the C++20 modules feature (using clion 2020.3), and although I selected c++20 for my project, the compilation of a simple hello world program fails because of that specific modules instruction that you can see below in the first line of the program, how can I make it work ?

import <iostream>;

int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}

1
3 comments

It seems that CMake now supports modules.

I am able to configure, build and run a simple C++20 project. It works on the CLI, in CLion and in Visual Studio.

However, CLion highlights in red everything related to C++20 modules. I understand that MSVC has its own way of classifying modules, but it would be wonderful if it could work out of the box.

0

Please sign in to leave a comment.