2

R が統合されている Visual Studio 2010 で ac# アプリケーションを実行すると、次のエラーが表示されます。The program can't start because Rlapack.dll is missing from your computer. Try reinstalling the program to fix this problem. プログラムを再インストールしようとしましたが、機能しませんでした。マトリックスが入っているフォルダにも入れてみましたが、うまくいきませんでした。この解決策はStackOverflow Qで提案されました。

64 ビットの Windows 7 を実行しています。アプリケーションは 32 ビットです。dll が 2 つあります。1 つは i386 というフォルダーにあり、もう 1 つはフォルダー x64 にあります。

これが私のコードです:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using RDotNet;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {



        public Form1()
        {
            InitializeComponent();
            string dlldir = @"D:\Program Files\R-2.15.0\bin\i386";

            bool r_located = false;


            while (r_located == false)
            {
                try
                {
                    REngine.SetDllDirectory(dlldir);
                    REngine.CreateInstance("RDotNet");
                    r_located = true;
                }

                catch
                {
                    MessageBox.Show(@"Unable to find R installation's \bin\i386 folder.
                    Press OK to attempt to locate it.");


                }
            }
        }
    }
}
4

3 に答える 3

2

これが私がやったことで、うまくいきました。dllをアプリケーションのbinフォルダーに入れました。

于 2012-06-10T10:11:38.383 に答える
1

beforedll を呼び出してパス変数を設定してみてください。

     var envPath = Environment.GetEnvironmentVariable("PATH");
     string s = null;
     if (Environment.Is64BitProcess)
         s = @"C:\Program Files\R\R-2.15.0\bin\x64";
     else
         s = @"C:\Program Files\R\R-2.15.0\bin\i386";
     Environment.SetEnvironmentVariable("PATH", envPath + Path.PathSeparator + s);
于 2013-12-03T19:19:30.107 に答える