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

OneAPI in Visual Studio on Windews 11 with MSVC C++ compiler for C code

haslim
Beginner
59 Views

ello

I use the OneAPI with the Visual Studio 2019 IDE on Windows 11 to develop Fortran code that uses the complex double precision type. I now want to link this code to a number of C functions using the ISO_C_BINDING module in Fortran.
However it appears the C++ compiler used in the VS IDE is by default the Legacy MSVC compiler which claims to be C99 compliant. I suppose this is not completely true as the C function returns a value declared as double complex and the MSVC compiler reports an error. It interprets complex as a variable and an explanation may be in this link

https://learn.microsoft.com/en-us/cpp/c-runtime-library/complex-math-support?view=msvc-160

It provides work arounds using typedef but this does not cover all double complex math like working with binary operators?
Is there a way to select the Intel C++ compiler in the IDE to replace MSVC?

Thanks

haslim

0 Kudos
0 Replies
Reply