环境:red flag linux 6.0 SP1,QT 4.4.3
源代码 :#include <Qstring>
#include <qfile.h>
#include <iostream>
using namespace std;
int main(int argc,char *argv[])
{
Qstring str1;
Qstring str2;
cout<<"please input a file pathname:";
cin>>str1;
cout<<"please input a file new pathname:";
cin>>str2;
QFile file;
file.copy(str1,str2);
return 0;
}
运行时报错:
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.4.3/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.4.3/include/QtCore -I/usr/local/Trolltech/Qt-4.4.3/include/QtCore -I/usr/local/Trolltech/Qt-4.4.3/include/QtGui -I/usr/local/Trolltech/Qt-4.4.3/include/QtGui -I/usr/local/Trolltech/Qt-4.4.3/include -I. -I. -I. -o copy.o copy.cpp
copy.cpp:1:19: error: Qstring: 没有那个文件或目录
copy.cpp: In function ‘int main(int, char**)’:
copy.cpp:9: error: ‘Qstring’ was not declared in this scope
copy.cpp:9: error: expected `;' before ‘str1’
copy.cpp:10: error: expected `;' before ‘str2’
copy.cpp:12: error: ‘str1’ was not declared in this scope
copy.cpp:14: error: ‘str2’ was not declared in this scope
copy.cpp: At global scope:
copy.cpp:7: warning: unused parameter ‘argc’
copy.cpp:7: warning: unused parameter ‘argv’
make: *** [copy.o] 错误 1
Qstring是
QT4下面库呀,怎么会找不到,请问应该怎么样解决!
[ 此贴被blueliang在2008-12-15 10:59重新编辑 ]