移植qt-everywhere-opensource-src-4.6.3出现下面这个错误

In file included from ../../include/QtCore/qlist.h:1,
from ../../include/QtCore/../../src/corelib/kernel/qobject.h:50,
from ../../include/QtCore/qobject.h:1,
from ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:45,
from ../../include/QtCore/qcoreapplication.h:1,
from global/qt_pch.h:58:
../../include/QtCore/../../src/corelib/tools/qlist.h:54:15: error: new: No such file or directory
../../include/QtCore/../../src/corelib/tools/qlist.h: In member function ‘void QList::node_construct(QList::Node*, const T&) [with T = QString]’:
../../include/QtCore/../../src/corelib/tools/qlist.h:426: instantiated from ‘void QList::append(const T&) [with T = QString]’
../../include/QtCore/../../src/corelib/tools/qstringlist.h:70: instantiated from here
../../include/QtCore/../../src/corelib/tools/qlist.h:341: error: no matching function for call to ‘operator new(unsigned int, QList::Node*&)’
:0: note: candidates are: void* operator new(unsigned int)
../../include/QtCore/../../src/corelib/tools/qlist.h: In member function ‘void QList::node_copy(QList::Node*, QList::Node*, QList::Node*) [with T = QString]’:
../../include/QtCore/../../src/corelib/tools/qlist.h:618: instantiated from ‘QList& QList::operator+=(const QList&) [with T = QString]’
../../include/QtCore/../../src/corelib/tools/qstringlist.h:85: instantiated from here
../../include/QtCore/../../src/corelib/tools/qlist.h:360: error: no matching function for call to ‘operator new(unsigned int, QList::Node*)’
:0: note: candidates are: void* operator new(unsigned int)
make[1]: *** [.pch/release-shared-emb-arm/QtCore.gch/c++] Error 1
请问 怎么解决呢 在网上搜索很久没有解决方案 求指教!!!!

3个回答

头文件不对,定义也找不到

根据你的错误提示分析 错误原因在于你移植的安装包中缺少qlist.h文件 这可能是安装包不全导致的也可能本身就是一个安装BUG 解决方法:1 重新下载一个QT安装包 2 下载一个同样版本的qlist.h文件加载到相应目录 这样错误应该能够解决

ycw007
无规矩不成方圆 回复zhulei198907: 我的建议是把缺少的头文件拷贝到相应目录,不要修改源码。如果你把源码修改了 其他的头文件可能会找不到。
5 年多之前 回复
zhulei198907
至尊宝他弟--至尊玉 我使用了 不同版本都是同样的问题
5 年多之前 回复

比如 编译时error: new: No such file or directory 在源码中是这样的 include 提示找不到 我在我的机器上 /usr/include 中找了下 发现它在/usr/include/c++/目录下 我修改后 #include 再次make 还是同样的问题 我也是无奈 在网上查资料也没有 囧

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问