필터 지우기
필터 지우기

loadlibrary function error "failed to preprocess"

조회 수: 21 (최근 30일)
Corentin Mailliet
Corentin Mailliet 2023년 7월 12일
댓글: Corentin Mailliet 2023년 7월 17일
Hi,
i have trouble with the loadlibrary function.
To make it simple, i went to the Matlab Help and tried to use the example given... (see below)
addpath(fullfile(matlabroot,'extern','examples','shrlib'))
if not(libisloaded('shrlibsample'))
loadlibrary('shrlibsample')
end
libfunctions('shrlibsample')
and i get this error :
Error using loadlibrary
Failed to preprocess the input file.
Output from preprocessor is:'C:\Program' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
I am on Windows 10 but with alot of security restrictions that could explain this, but as i am not knowing what loadlibrary is trying to do ... i cant try to fix it.
Any idea ?
Thanks in advance

채택된 답변

Niranjan Sundararajan
Niranjan Sundararajan 2023년 7월 12일
Got it,
I think that the file is not able to process spaces in the function. The directory structure of windows machines is "C:\Program Files\..." but your preprocessor gives output that it does not recognize "C:\Program" as an internal or external command, operable program or batch file.
I believe you are using the MinGW-w64 compiler and that does not support spaces in its path. For more info, refer to MATLAB documentation -- https://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html
You can reinstall the MinGW compiler using C:\mingw-64 as the root directory. Then, your loadlibrary function should work fine.
  댓글 수: 3
Niranjan Sundararajan
Niranjan Sundararajan 2023년 7월 12일
Sure, I would appreciate a thumbs up if you found the answer helpful :)
Corentin Mailliet
Corentin Mailliet 2023년 7월 17일
so, it worked. However i have a problem on the rights i dont have, but it's not an issue the community could help me with! Thanks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by