这两天在整Qt控制Word文档,根据自带的例子outlook,我仿照他生成了word.cpp word.h office.h office.cpp , 但是
编译不通过
例子中的outlook我能编译通过。我的
问题就很多,基本如下:
就这个函数,其余的类同:
这个是office.h里面的,红色
部分是上面一行的
错误inline int ColorFormat::RGB() const
//D:\officeSrc\office.h:37807: error: C2143: syntax error : missing ';' before '::'
//office.h(37807) : warning C4003: not enough actual parameters for macro 'RGB'
//d:\officesrc\office.h:37807: error: C2059: syntax error : '::'//\officesrc\office.h(37808) : error C2143: syntax error : missing ';' before '{'
//\officesrc\office.h:37807: warning: C4091: 'inline ' : ignored on left of 'int' when no variable is declared{
//D:\\office.h:37807: error: C2589: '(' : illegal token on right side of '::'//\officeSrc\office.h:37808: error: C2447: '{' : missing function header (old-style formal list?)//\office.h:37807: error: C2143: syntax error : missing ';' before '::'//\officeSrc\office.h:37807: error: C2059: syntax error : '::'//.........................还有十条左右 QVariant qax_result = property("RGB");
Q_ASSERT(qax_result.isValid());
return *(int*)qax_result.constData();
}
问题主要就出在函数的定义头部分,Qt用的VC2010的编译;求大家指教