// Point.vala
namespace Test {
class Point {
public const int MY_CONST = 123;
public float x { get; set; }
public float y { get; set; }
}
}
vala ソース ファイル 'Point.vala' があります。
- --vapi
valac --vapi=Point.vapi --library=point -X -shared Point.vala
:
// Point.vapi
namespace Test {
}
空の...
- --内部-vapi
valac --internal-vapi=Point.vapi --header=Point.h --internal-header=Point_internal.h --library=point -X -shared Point.vala
:
// Point.vapi
namespace Test {
[CCode (cheader_filename = "Point_internal.h")]
internal class Point {
public const int MY_CONST;
public Point ();
public float x { get; set; }
public float y { get; set; }
}
}
それは完璧に思え、私にとってはうまくいきます
- --fast-vapi
valac --fast-vapi=Point.vapi --library=point -X -shared Point.vala
:
// Point.vapi
using GLib;
namespace Test {
internal class Point {
public const int MY_CONST = 123; // error
public Point ();
public float x { get; set; }
public float y { get; set; }
}
}
error: External constants cannot use values
このvapi を使用すると、エラーが発生します。
Q1 : 厳密な違いは何ですか? そして、なぜオプションがあるのですか。
Q2 : 共有ライブラリを作成するには --internal-vapi を使用する必要がありますか?