필터 지우기
필터 지우기

Error message from c++ compiler is messy when build mex file.

조회 수: 2 (최근 30일)
Jiangfeng Liu
Jiangfeng Liu 2022년 4월 21일
답변: Abhishek Chakram 2023년 12월 27일
I'm building some mex files from c++ source files using Microsoft visual studio 2017 as the compiler. But the error message is not readable. I think it's encoding problem, but I don't know how to solve it. Can someone help me?

답변 (1개)

Abhishek Chakram
Abhishek Chakram 2023년 12월 27일
Hi Jiangfeng Liu,
It appears to me that you are facing difficulty in building mex files from c++ source files using Microsoft visual studio 2017 as the compiler. The error message you are seeing is likely due to a mismatch between the character encoding used by Visual Studio's output and the encoding expected by MATLAB's command window or the console where you are viewing the message. Here are few ways to resolve the encoding issue:
  • Change Console Code Page:
1. Open a Command Prompt window.
2. Before running MATLAB, change the code page to UTF-8 by typing “chcp 65001”.
3. Start MATLAB from this Command Prompt window and try building the MEX file again.
  • Change MATLAB's Default Character Encoding: In MATLAB, you can change the default character set to UTF-8 by running the following command:
feature('DefaultCharacterSet', 'UTF-8');
After setting this, try to compile the MEX file again.
I hope this helps.
Best Regards,
Abhishek Chakram

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by