1

mrubyをコンパイルしようとしています。コマンドラインから何かをコンパイルするのはこれが初めてです。ディレクトリでmakeを実行すると、次のようになります。

make -C mrblib --no-print-directory CC=gcc LL=gcc
make -C ../tools/mrbc --no-print-directory CC=gcc LL=gcc
gcc -Wall -Werror-implicit-function-declaration -g -MMD -I../../src -I../../src/../include -c ../../src/st.c -o ../../src/st.o
In file included from ../../src/regint.h:93,
                 from ../../src/st.c:6:
../../src/../include/mruby.h: In function ‘mrb_special_const_p’:
../../src/../include/mruby.h:100: warning: comparison is always true due to limited range of data type
../../src/st.c: In function ‘st_hash’:
../../src/st.c:1053: error: ‘SIZEOF_ST_INDEX_T’ undeclared (first use in this function)
../../src/st.c:1053: error: (Each undeclared identifier is reported only once
../../src/st.c:1053: error: for each function it appears in.)
make[2]: *** [../../src/st.o] Error 1
make[1]: *** [../bin/mrbc] Error 2
make: *** [src/mrblib/mrblib.o] Error 2

Mac OS X 10.7.3 でのビルド 足りない手順はありますか? ありがとう

4

3 に答える 3

2

この問題は数時間前に修正されました。トランクの新しいコピーを取得するだけです。

于 2012-04-21T16:31:36.283 に答える
1

私はこれをWindowsで動作させました。人々がそれを必要とする場合に備えて、それを共有します:)

私が使用したもの: Windows OS、mingw コンパイラ、bison (バイナリと依存関係を抽出しないと、dll が見つからないというエラーが発生します) ruby

環境変数PATHに(mindw、bison、ruby)のbinフォルダを全て設定します。

次に、mruby フォルダー内で次を実行します: mingw32-make.exe (これは mingw の Bin フォルダーにあります)。

すべての PATH 変数が正しく設定されていれば、コードはコンパイルされるはずです。

これで、実行可能ファイルを含む .\build\host\bin と、必要なライブラリを含む .\build\host\lib が表示されます。

次に、C++ プログラムを作成します (私は C::B を使用しました)。

#include <stdlib.h>
#include <stdio.h>
#include <mruby.h>
#include <mruby/compile.h>

int main(void)
{
  mrb_state *mrb = mrb_open();
  if (!mrb) { /* handle error */ }
  puts("Executing Ruby code from C!");
  mrb_load_string(mrb, "p 'hello world!'");
  mrb_close(mrb);
  return 0;
}

@Andrewの例はうまくいきませんでした。エラーが発生しました: 'mrb_load_string' はこのスコープで宣言されていません

次を含めることでエラーを修正しました: #include

これがWindows用のライブラリをセットアップするのに非常に役立つことを願っています!

于 2015-06-06T16:25:49.660 に答える