2016-06-07 287 views
0

我是Scilab/Xcos的新手,想要第一次安裝它。我注意到我想嘗試的一些Xcos塊需要一個C編譯器。Scilab with Visual Studio 2015

我已經安裝了Visual Studio 2015 Professional,並且在Scilab中,如果我運行了findmsvccompiler,它將返回msvc100pro。如果我運行configure_msvc,則返回T(true?)。

但是,當我運行haveacompiler時,它返回F(false?)。

有什麼辦法可以在Scilab上使用VS2015的編譯器嗎?我知道supported compilers頁面只列出了VS2013,但看起來這個頁面在VS2015發佈之前最後更新了。

有沒有辦法手動設置Scilab使用VC++ 2015編譯器?或者我必須去安裝MinGW編譯器?

回答

1

我最近發現了一個for 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", "Software\Microsoft\DevDiv\vc\Servicing\14.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", "Software\Microsoft\DevDiv\vs\Servicing\14.0\devenv", "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 
//=============================================================================