【问题标题】:Strange Matlab error while building using Matlab coder使用 Matlab 编码器构建时出现奇怪的 Matlab 错误
【发布时间】:2013-01-02 21:41:01
【问题描述】:

我上次使用的 Matlab 编码器构建的东西很好(那是 2 个月前),但现在当我尝试用它构建项目时,我收到以下错误:

\>> coder -build get_scores.prj     
Warning: 'perl: warning: Setting locale failed.    
perl: warning: Please check that your locale settings:    
LC_ALL = "en_GB",    
LANG = (unset)    
are supported and installed on your system.    
perl: warning: Falling back to the standard locale ("C").    
VSINSTALLDIR'    
exceeds MATLAB's maximum name length of 63 characters and has been truncated to    
'perl: warning: Setting locale failed.    
perl: warning: Please che'.     
\> In CompilerConfigurationFactory>CompilerConfigurationFactory.determineLocation at 275    
In CompilerConfigurationFactory>CompilerConfigurationFactory.process at 130    
In getCompilerConfigurations at 56    
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\compilerman.p>parse_opts_file at 57    
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\compilerman.p>compilerman at 15    
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\emlckernel.p>emlckernel/getCompilerName at 148    
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\emlckernel.p>emlckernel/finalizeProject at 711    
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\emlckernel.p>emlckernel at 36    
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\codeProject.p>codeProject/doit at 8    
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\private\codeProject.p>codeProject at 13    
In C:\Program Files\MATLAB\R2011b\toolbox\coder\coder\emlcprivate.p>emlcprivate at 18     
The current MEX compiler '`<unknown>`' is not supported.    
Use mex -setup to select a supported compiler.    
Use help codegen for more information on using this command.    

我已经多次运行 mex -setup,选择了 Visual Studio(这是我之前使用的并且运行良好),然后重新运行 Build 命令,但同样的错误反复出现。此外,“超过 MATLAB 的 63 个字符的最大名称长度并且已被截断”部分似乎表示 Matlab 以某种方式将 Perl 警告解释为某个变量名称 - 我不知道那里发生了什么。

我也不确定为什么会出现 Perl 警告 - LC_ALL 之前未设置,现在是 en_GB,但无论如何都会出现相同的错误。

任何纠正此问题的步骤将不胜感激。

【问题讨论】:

    标签: matlab build-error


    【解决方案1】:

    好的,仔细查看消息后,我猜想Matlab 正在尝试在内部使用Perl 获取变量名VSINSTALLDIR,并且警告消息正在抛出它。我尝试在命令行上运行 Perl 以确认警告也出现在那里。然后在寻找修复语言环境错误的方法时(谷歌搜索只为 linux 和 Mac 系统提供了解决方案),我找到了一种方法来简单地抑制 this page 上的 Perl 警告。这样做之后,上面的错误就消失了。

    【讨论】:

    • 我建议您接受自己的答案,否则问题将保持开放状态。
    猜你喜欢
    • 2014-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-07
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多