首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

qt编译multiple definition of异常

2013-07-24 
qt编译multiple definition of错误学习QT编程,编译时出现multiple definition of错误,? 4 people::people(

qt编译multiple definition of错误

学习QT编程,编译时出现multiple definition of错误,

? 4 people::people()
? 5 {
? 6???? connect(this, SIGNAL(sig1()), this, SLOT(slo1()));
? 7 }
? 8
? 9 people::~people()
?10 {}
?11 /*
?12 void people::sig1()
?13 {??????????????????????????????????????????????????????????????????????????
?14???? printf("in sig.\n");
?15 }
?16 */
?17 void people::slo1()
?18 {
?19???? printf("in slo.\n");
?20 }

原来,QT预处理工具会将people.cpp中宏展开为moc_people.cpp,moc_people.cpp中包含了

101 void people::sig1()
102 {
103???? printf("in sig1.\n");
104???? QMetaObject::activate(this, &staticMetaObject, 0, 0);
105 }

?

具体宏是怎么处理的,下面继续学习。

热点排行