OOLUA编译器错误

我正在尝试使用OOLUA编译一个简单的程序,但我遇到了无法解释的错误。

代码:

#include <oolua.h>
#include <iostream>

class TestClass
{
public:
TestClass() { std::cout << "foo" << std::endl; }
~TestClass() { std::cout << "bar" << std::endl; }
};

OOLUA_CLASS_NO_BASES(TestClass)
OOLUA_NO_TYPEDEFS
OOLUA_CLASS_END

int main()
{
    OOLUA::Script vm;
    vm.register_class<TestClass>();

    OOLUA::run_chunk(vm, "obj = TestClass.new() ");
}

我正在使用MinGW w64 4.9.2 i686进行编译。它产生的错误是:

7 error: 'OOLUA_NO_TYPEDEFS' does not name a type
16 expected '}' at end of input
251 error: expected unqualified-if at end of input
251 expected '}' at end of input

当使用更多的宏时,会有更多的编译错误,但目前它无法处理一个简单的程序。任何输入都将不胜感激。

点赞