免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1050 | 回复: 0
打印 上一主题 下一主题

qt trouble shutting (NO 1): ISO C++ forbids ... [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-01-05 21:23 |只看该作者 |倒序浏览

               
qt  how to get rid of the compile problem: 
error: ISO C++ forbids casting to an array type `char qt_invoke(int, QUObject*)'
Description:
I have a slot which is declared in designer's Object Explorer ,as:
infoDialogShow( char [] ename, char [] cname)
when compilling the whole project,i got the following errors:
  .moc/moc_formmain.cpp:
In method `bool
formmain::qt_invoke(int, QUObject *)':
  .moc/moc_formmain.cpp:232: ANSI C++ forbids casting to
an array type 'char []'
to solve this problem,first ,change the declaration of infoDialogShow() to 
infoDialogShow( char * ename, char *cname)
and recompile,no more error.
Note:
1.ANSI C++ forbids casting to
an array type 'char []' :means declaration of char [] as perameter is not allowed,so we should use char * .
2.some sites for reference:
(1).
Storing string deep copy in c++ vector of char array?
http://answers.yahoo.com/question/index?qid=20081003134132AAqjNtX
(2).
Qt-interest Archive, April 2003.qmake: doesn't work with typedef'ed arrays?
   http://lists.trolltech.com/qt-interest/2003-04/thread00395-0.html
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/61322/showart_1775888.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP