I am using a visual studio template to produce Matlab MEX functions. Using this template alone, I can compile functions from Visual Studio using either Visual Studio's compiler or one of the Intel C++/DPC++ compilers. However, when I include mkl libraries, I encounter an error at the include line saying "cannot open source file mkl.h"
I have included and linked all the relevant directories and libraries. Here are the command lines from the configuration properties in visual studio. Why could this be happening?
C/C++ Properties:
/GS /TP /W3 /I"C:\Program Files (x86)\Intel\oneAPI\mkl\latest\include"
/I"C:\Program Files\MATLAB\R2023a\extern\include\" /I"C:\Program Files\MATLAB\R2023a\simulink\include\" /Z7 /O2 /Zp8 /D "USE_MEX_CMD"
/D "_CRT_SECURE_NO_DEPRECATE" /D "_SCL_SECURE_NO_DEPRECATE" /D "_SECURE_SCL=0"
/D "MATLAB_MEX_FILE" /D "__INTEL_LLVM_COMPILER=20230100" /D "_WINDLL" /Zc:forScope /GR
/MD /Fa"C:\Users\nikun\source\repos\JCFMKL\JCFMKL\build\x64\Release\" /EHs
/nologo /Fo"C:\Users\nikun\source\repos\JCFMKL\JCFMKL\build\x64\Release\"
//fprofile-instr-use "C:\Users\nikun\source\repos\JCFMKL\JCFMKL\build\x64\Release\"
/Fp"C:\Users\nikun\source\repos\JCFMKL\JCFMKL\build\x64\Release\JCFMKL.pch"
Linker Properties
/OUT:"C:\Users\nikun\source\repos\JCFMKL\bin\x64\Release\JCFMKL.mexw64" /MANIFEST
/NXCOMPAT /PDB:"C:\Users\nikun\source\repos\JCFMKL\bin\x64\Release\JCFMKL.mexw64.pdb"
/DYNAMICBASE "mkl_rt.lib" "mkl_intel_c.lib" "mkl_intel_thread.lib" "mkl_intel_lp64.lib"
"mkl_core.lib" "libiomp5md.lib" "libmx.lib" "libmex.lib" "libmat.lib"
"libMatlabDataArray.lib" "libMatlabEngine.lib" "kernel32.lib" "user32.lib" "gdi32.lib"
"winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib"
"uuid.lib" "odbc32.lib" "odbccp32.lib"
/IMPLIB:"C:\Users\nikun\source\repos\JCFMKL\bin\x64\Release\JCFMKL.lib" /DLL /MACHINE:X64
/INCREMENTAL:NO /MANIFESTUAC:"level='asInvoker' uiAccess='false'"
/ManifestFile:"C:\Users\nikun\source\repos\JCFMKL\JCFMKL\build\x64\Release\JCFMKL.mexw64.int
ermediate.manifest" /NOLOGO /LIBPATH:"C:\Program Files
(x86)\Intel\oneAPI\mkl\latest\lib\intel64" /LIBPATH:"C:\Program Files
(x86)\Intel\oneAPI\mkl\latest\lib" /LIBPATH:"C:\Program
Files\MATLAB\R2023a\extern\lib\win64\microsoft\" /TLBID:1