一个关于wvstreams很怪异的编译问题!
我准备交叉编译wvstreams到我的开发板上,但是发现编译下面的文件时老是出问题,不得其解,期望高手提示一二。
template <class RET>
class WvCallbackBase
{
protected:
public:
// Fake is a boring object type that we use for calling our "generic"
// member function pointers. Strangely, it crashes if Fake doesn't
// have a virtual table, so we have an empty virtual function to make it
// happy. (This is all a bit evil, but only because C++ sucks. When
// they pass me a callback, they _know_ which function I want to call; I
// don't need to resolve it at runtime...)
struct Fake { virtual void silly() {} };
// FakeFunc is a completely generic member-function pointer. Actually the
// functions we _really_ call aren't part of the Fake class and probably
// have different parameters, but some hideous typecasts should fix that
// right up.
typedef RET (Fake::*FakeFunc)();
typedef RET (*FakeGlobalFunc)();
Fake *obj;
union {
FakeFunc func;
FakeGlobalFunc globalfunc;
};
WvCallbackBase::WvCallbackBase(void *_obj, FakeFunc _func)
: obj((Fake *)_obj), func(_func)
{ }
WvCallbackBase::WvCallbackBase(FakeGlobalFunc _func)
: obj(0), globalfunc(_func)
{ }
...
};
我的交叉编译器老是提示Fake has not been undeclared,但是使用标准g++编译是没有问题的,请问这是怎么一回事啊?