问题描述
- 移植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
请问 怎么解决呢 在网上搜索很久没有解决方案 求指教!!!!
解决方案
头文件不对,定义也找不到
解决方案二:
根据你的错误提示分析 错误原因在于你移植的安装包中缺少qlist.h文件 这可能是安装包不全导致的也可能本身就是一个安装BUG 解决方法:1 重新下载一个QT安装包 2 下载一个同样版本的qlist.h文件加载到相应目录 这样错误应该能够解决
解决方案三:
比如 编译时error: new: No such file or directory 在源码中是这样的 include 提示找不到 我在我的机器上 /usr/include 中找了下 发现它在/usr/include/c++/目录下 我修改后 #include 再次make 还是同样的问题 我也是无奈 在网上查资料也没有 囧
时间: 2024-10-21 12:46:07