我是Scilab/Xcos的新手,第一次尝试设置它。我注意到我想尝试的一些 Xcos 块需要一个 C 编译器。
我已经安装了Visual Studio 2015 Professional,在Scilab中,如果我运行findmsvccompiler
,它会返回msvc100pro
。如果我运行configure_msvc
,它会返回T
(真的吗?
但是,当我运行haveacompiler
时,它会返回F
(假?
有没有办法将VS2015的编译器与Scilab一起使用?我知道支持的编译器页面最多只列出VS2013,但看起来该页面上次更新是在VS2015发布之前。
有没有办法手动设置 Scilab 以使用 VC++ 2015 编译器?还是我必须去安装 MinGW 编译器?
我最近找到了 scicos 6.0.0 和 VC 2015 Express 的解决方法。 问题似乎是检测错误的键(请参阅dlwIsVc14Express.sci)。但是创建此密钥是不够的。
我选择的方法是将这些行复制粘贴到 scilab 6.0.0 控制台中。然后XCOS编译一个示例对我来说很好。
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) DIGITEO - 2010 - Allan CORNET
// Copyright (C) Scilab Enterprises - 2014 - Antoine ELIAS
//
// Copyright (C) 2012 - 2016 - Scilab Enterprises
//
// This file is hereby licensed under the terms of the GNU GPL v2.0,
// pursuant to article 5.3.4 of the CeCILL v.2.1.
// This file was originally licensed under the terms of the CeCILL v2.1,
// and continues to be available under such terms.
// For more information, see the COPYING file which you should have received
// along with this program.
// copy paste this modified function in scilab 6.0.0 console , then xcos compile
//=============================================================================
function bOK = dlwIsVc14Express()
bOK = %f;
try
if winqueryreg("key", "HKLM", "SoftwareMicrosoftDevDivvcServicing14.0") <> [] then
bOK = %t;
end
catch
end
endfunction
//=============================================================================
//=============================================================================
// NDLA : I don't know the righ key to chose for dlwIsVc14Pro : change default function here
/*
function bOK = dlwIsVc14Pro()
bOK = %f;
try
if winqueryreg("HKLM", "SoftwareMicrosoftDevDivvsServicing14.0devenv", "install") == 1 & ...
dlwIsVc14Express() == %f then
bOK = %t;
end
catch
end
endfunction
*/
//=============================================================================
//=============================================================================
function MSCompiler = dlwFindMsVcCompiler()
MSCompiler = "unknown"; // unknown
// We use always last version of MS compiler
val = getenv("SCILAB_PREFERED_MSVC", "");
if val <> "" then
funcs = list(dlwIsVc14Express,dlwIsVc14Pro,dlwIsVc14Express,dlwIsVc12Pro,dlwIsVc11Express,dlwIsVc11Pro,dlwIsVc10Express,dlwIsVc10Pro);
compilers = [ ...
"msvc140express";
"msvc140pro";
"msvc120express";
"msvc120pro";
"msvc110express";
"msvc110pro";
"msvc100express";
"msvc100pro";];
idx = find(val == compilers);
if idx <> [] then
func = funcs(idx);
if func() then
MSCompiler = val;
return;
end
end
end
if dlwIsVc14Express() then
MSCompiler = "msvc140express"; // Microsoft Visual 2015 Express
return;
end
if dlwIsVc14Pro() then
MSCompiler = "msvc140pro"; // Microsoft Visual 2015 Professional / Community (or more)
return;
end
endfunction
//=============================================================================