Author Topic: Support for c++20 modules  (Read 225 times)

Offline sm0ke

  • Single posting newcomer
  • *
  • Posts: 2
Support for c++20 modules
« on: April 16, 2021, 11:40:29 pm »
Hello, i like this IDE. But it's not allow to use modules in cpp.
Does the modules will be available by code::blocks in near future?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13198
    • Travis build status
Re: Support for c++20 modules
« Reply #1 on: April 17, 2021, 01:00:26 am »
Probably but someone needs to research how to do it.
Do you use a compiler which supports the final/standard variant of modules?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sm0ke

  • Single posting newcomer
  • *
  • Posts: 2
Re: Support for c++20 modules
« Reply #2 on: April 17, 2021, 04:25:24 am »
I tried mingw64 snapshot version:
http://winlibs.com/
> GCC 11.0.1 snapshot 20210228 (experimental) + MinGW-w64 8.0.0 - release 1

It can compile modules when compile with "-fmodules-ts". But in the "export module _name;" _name should coincide with the file name. And file extension should be .cpp (not .ixx). Or it's not work.

Also... There is MSVC 19 Preview. Module file should be with .ixx extension (or with appropriate property).

Do not forget to recompile .cpp file that imports changed module. And module should be compiled before .cpp (or .h) file that its use. (make dependencies like with #include)

upd: I forgot to mention that clang can do with modules too, but it is too weird to configure to make it work.
clang i used from here:
http://winlibs.com/
GCC 10.3.0 + LLVM/Clang/LLD/LLDB 11.1.0 + MinGW-w64 8.0.0 - release 1
« Last Edit: April 17, 2021, 05:25:34 am by sm0ke »