- 论坛徽章:
- 0
|
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 |
|