ゲームエンジン「ue4」で機械学習ライブラリ「dlib」を使えないかと四苦八苦しています。
先日ようやくue4にdlibを入れることができたのですが(といってもヘッダをインクルードしてソースファイルをプロジェクトに追加するだけ^^;)、
dlib内のファイルでコンパイルエラーが出てしまいます。
dlibを入れる前は正常にコンパイルできていたので、dlibの追加が原因では?と睨んでいます。
以下にエラーが出た箇所を記します。
template <
typename sbuf
>
class lzp_buffer_kernel_2
{
/*!
REQUIREMENTS ON sbuf
sbuf is an implementation of sliding_buffer/sliding_buffer_kernel_abstract.h
T == unsigned char
INITIAL VALUE
- buffer.size() == the size as defined by the constructor
- table_size == the number of elements in the table3 and table4 arrays
- for all i: buffer[i] == 0
- for all i: table3[i] == buffer.size()
- for all i: table4[i] == buffer.size()
CONVENTION
- table_size == the number of elements in the table3 and table4 arrays
- size() == buffer.size()
- operator[](i) == buffer[i]
- last_element == buffer.size()-1
This is LZP with an order-5-4-3 model with context confirmation.
To save memory the order5 and order3 predictions exist in the same
table, that is, table3.
!*/
public:
explicit lzp_buffer_kernel_2 (
unsigned long buffer_size
);
virtual ~lzp_buffer_kernel_2 (
);
void clear(
);
inline void add (
unsigned char symbol
);
inline unsigned long predict_match (
unsigned long& index
);
inline unsigned long size (
) const;
inline unsigned char operator[] (
unsigned long index
) const;
private:
inline bool verify (
unsigned long index
) const
/*!
ensures
- returns true if buffer[index]'s context matches the current context
!*/
{
if (index+3 < buffer.size())
{
if (buffer[0] != buffer[index+1])
return false;
if (buffer[1] != buffer[index+2])
return false;
if (buffer[2] != buffer[index+3])
return false;
return true;
}
else
{
// just call this a match
return true;
}
}
sbuf buffer;
unsigned long* table3;
unsigned long* table4;
unsigned long last_element;
const unsigned long table_size;
// restricted functions
lzp_buffer_kernel_2(const lzp_buffer_kernel_2<sbuf>&); // copy constructor
lzp_buffer_kernel_2<sbuf>& operator=(const lzp_buffer_kernel_2<sbuf>&); // assignment operator
};
63行目:型 'bool' は不要です。
63行目:'{' の前に予期しないトークンがありました。関数の本体は無視されます
70行目:型指定子がありません - int と仮定しました。メモ: C++ は int を既定値としてサポートしていません
70行目:構文エラー: '{'
70行目:'{' の前に予期しないトークンがありました。関数の本体は無視されます
inline bool verify関数でエラーが起きているようなのですが原因がわかりません。(こいつだけヘッダ内で定義されてるから?)
[hr]
ライブラリの追加によりライブラリ内のファイルでエラーが起きてしまう原因はなんでしょうか?
似たような経験がある方で原因がわかる方はぜひご教授ください<(_ _)>
解決策も一緒に教えていただけるとよりいっそう喜びます^p^