How to get Matlab C++ compiler name in my program?
조회 수: 3 (최근 30일)
이전 댓글 표시
I am developing a C++ application and I need to get the C/C++ compiler name of Matlab (2017b and newer). I have already tried using Matlab Engine C++ API for launching an engine and then running:
mex -setup C++
But this approach is taking a long time to be completed. Is there any better approach to get the C/C++ compiler name of Matlab without launching a Matlab instance (e.g. reading a configuration file, etc.)?
댓글 수: 0
답변 (1개)
Rik
2022년 2월 25일
If starting Matlab is fine, then this code will get you all the info you need:
details=get_cpp_compiler_info
function details=get_cpp_compiler_info
cc=mex.getCompilerConfigurations;
for details=cc(:).'
if strcmp(details.Language,'C++'),return,end
end
error('C++ compiler not found')
end
If that is not an option, you could try reading the xml file in the prefdir:
fn=sprintf('%s%smex_C++_%s.xml',prefdir,filesep,mexext)
Although you should be aware that I could only find this file on Windows.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!