Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
789 Discussions

Simple code compiles with latest visual studio C++ compiler but not with Intel 2025 C++ compiler

Olórin
Novice
966 Views

I have a simple code : in toto.ixx file :

 

module;

#include <iostream>
#include <typeinfo>
#include <utility>

export module math;

template <typename T>
auto showType(T&&t)
{
    return typeid(std::forward<T>(t)).name();
}

export namespace math
{
    template <typename T, typename T2>
    auto sum(T fir, T2 sec)
    {
        auto res = fir + sec;
        return std::make_pair(res, showType(res));
    }
}

and in ConsoleApplication3.cpp :

 

#include <iostream>
import math;

int main()
{
    auto [val, message] = math::sum(2000, 3.14159);
    std::cout << "math::sum(2000, 11) : " << val << "; type: " << message << '\n';
}

This compiles and executes fine with latest Visual Studio Professional 2022 C++ compiler while it doesn't compile with Intel C++ 2025 compiler, the build output being :

 

1>------ Build started: Project: ConsoleApplication3, Configuration: Debug x64 ------
1>C:\pah\to\solutions\ConsoleApplication3\ConsoleApplication3\ConsoleApplication3.cpp(2,8): : error : module 'math' not found
1>    2 | import math;
1>      | ~~~~~~~^~~~
1>1 error generated.
1>Done building project "ConsoleApplication3.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 17:32 and took 02.479 seconds ==========

 

Of course "Preview - Features from the Latest C++ Working Draft (/std:c++latest)" is activated.

 

What is happening ? 

0 Kudos
0 Replies
Reply