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*
718 Discussions

When including "math.h" with "Intel C++ Compiler 2024", IntelliSense error "E1389" occurs.

daifuku
Beginner
1,517 Views

Hello.
This is my first post.

When I specify "Intel c++ Compiler 2024 (2024.1.0.2)" in a C++ project created with Visual Studio 2022 Pro and include "math.h", the following IntelliSense error is recorded.

 

  • Error Code: E1389
    Redeclaration cannot add dllexport/dllimport to "ldexpf" (declared at line 714, file name "C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\corecrt_math.h")

 

But the build (compile + link) is successful.

(The attached Dl1.zip is a project file that reproduces E1389.)

 

Is this an IntelliSense error that always occurs when using Intel c++ Compiler in Visual Studio, or is there something wrong with the way I create a project that uses Intel c++ Compiler?

The attached Dl1.zip is a project file that reproduces E1389.

Thank you.

0 Kudos
5 Replies
cw_intel
Moderator
1,399 Views

You can check the preprocess file and you can find that there are two ldexpf functions, one come from MS header file corecrt_math.h, and another from the Intel compiler header file:C:\\PROGRA~2\\Intel\\oneAPI\\compiler\\latest\\bin\\compiler\\..\\..\\opt\\compiler\\include\\math.h.   So there may be such an IntelliSense error.

0 Kudos
daifuku
Beginner
1,383 Views

Thank you for following .

 

It is true that the "corecrt_math.h" in the MS header causes an E1389 error to be recorded in Intellisense.

In my environment, when you select Intel c++ compiler 2024 in the project settings in Visual Studio, the following include path is automatically set.

[Include Path Search Order]
C:\Program Files (x86)\Intel\oneAPI\tbb\2021.12\include;
C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\include;
C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\opt\compiler\include;
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.40.33807\include;
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.40.33807\atlmfc\include;
C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\VS\include;
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt;
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um;
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared;
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\winrt;
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\cppwinrt;
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8.1\Include\um;


So #include <math.h> in test.cpp finds "C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\opt\compiler\include\math.h" before the MS header.

But test.cpp also does not reference "corecrt_ math.h" or "math.h" in the MS header, but the intellisense is affected by the MS header and records E1389.

Do you know if you have to manually adjust the order of the include paths after selecting Intel c++ compiler 2024 in Visual Studio?

 

0 Kudos
cw_intel
Moderator
1,311 Views

Escalated to our engineering team for further investigation. 


0 Kudos
cw_intel
Moderator
1,283 Views

I think this IntelliSense error will not affect the operation of your program, right?

We will fix this issue in future versions and this IntelliSense error will disappear.

If you want to get rid of this IntelliSense error now , there is a method, you can modify the file C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\opt\compiler\include\math.h,

Change the following code,

#if !defined(__INTEL_LLVM_COMPILER) || ((defined(__AVX512F__) || (__AVX256P_SUPPORTED__)) && defined(__INTEL_LLVM_COMPILER))

        #define ldexpf  __MS_ldexpf

 #endif

to

#define ldexpf  __MS_ldexpf

Please let me know if this method works for you.


Thanks.


0 Kudos
daifuku
Beginner
1,255 Views

Indeed, even if there is an "E1389" error in IntelliSense, I think it will not have any impact because you can still compile and run the program.

 

I changed "C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\opt\compiler\include\math.h" using the code you taught me.

// #if !defined(__INTEL_LLVM_COMPILER) || ((defined(__AVX512F__) || (__AVX256P_SUPPORTED__)) && defined(__INTEL_LLVM_COMPILER))
// #define ldexpf __MS_ldexpf
// #endif
#define ldexpf __MS_ldexpf

 

After the change, the "E1389" error is no recorded in IntelliSense.

Thank you.

 

0 Kudos
Reply