0
我學習一些Qt3代碼,我的環境是QT 4商業版,VS2010與qt-addin。當我添加預處理器「QT3_SUPPORT」時,QString的總是與一些像這樣的錯誤信息:QT4 QString編譯錯誤添加時QT3_SUPPORT
1> main.cpp
1>main.cpp(18): error C2248: 'QString::operator QNoImplicitBoolCast' : cannot access private member declared in class 'QString'
1> c:\qt\4.8.4\include\qtcore\../../src/corelib/tools/qstring.h(561) : see declaration of 'QString::operator QNoImplicitBoolCast'
1> c:\qt\4.8.4\include\qtcore\../../src/corelib/tools/qstring.h(62) : see declaration of 'QString'
1>
1>Build FAILED.
我的代碼是這樣的:
#include <QtCore/QCoreApplication>
#include <QString>
#include <Qt3Support>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QString b;
std::cout << "B" << b<<"\n";
return a.exec();
}
錯誤信息總是與使用QString的assicaited
std::cout << "B" << b<<"\n";
我GOOGLE了錯誤,但找到proting QT3 COE到qt4的一些信息,他們說我要補充QT3_SUPPORT,包括我這樣做,但還是有這樣的埃羅,所以我很困惑,並沒有那麼解決這個錯誤。