我的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 FilesMATLABR2011btoolboxcodercoderprivatecompilerman.p>parse_opts_file at 57
In C:Program FilesMATLABR2011btoolboxcodercoderprivatecompilerman.p>compilerman at 15
In C:Program FilesMATLABR2011btoolboxcodercoderprivateemlckernel.p>emlckernel/getCompilerName at 148
In C:Program FilesMATLABR2011btoolboxcodercoderprivateemlckernel.p>emlckernel/finalizeProject at 711
In C:Program FilesMATLABR2011btoolboxcodercoderprivateemlckernel.p>emlckernel at 36
In C:Program FilesMATLABR2011btoolboxcodercoderprivatecodeProject.p>codeProject/doit at 8
In C:Program FilesMATLABR2011btoolboxcodercoderprivatecodeProject.p>codeProject at 13
In C:Program FilesMATLABR2011btoolboxcodercoderemlcprivate.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正试图在内部使用Perl获取变量名VSINSTALLDIR,并且警告消息正在抛出它。我尝试在命令行上运行Perl以确认警告也出现在那里。然后,在搜索修复语言环境错误的方法时(google只给出了linux和Mac系统的解决方案),我找到了一种方法,可以简单地在此页面上抑制Perl警告。这样做之后,上面的错误就消失了。