linux qt编译安装问题解决记录

在编译Qt时遇到关于std::tr1未声明的错误,具体错误出现在wtf/TypeTraits.h文件中。错误同时涉及到has_trivial_constructor和has_trivial_destructor。此外,还警告std::auto_ptr已过时。参考链接提供了一个解决方案。

from ../3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:24,
from ../3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_exec.cpp:50:
../3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:173:69: error: ‘std::tr1’ has not been declared
template struct HasTrivialConstructor : public std::tr1::has_trivial_constructor { };
^~~
../3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:173:74: error: expected ‘{’ before ‘has_trivial_constructor’
template struct HasTrivialConstructor : public std::tr1::has_trivial_constructor { };
^~~~~~~~~~~~~~~~~~~
../3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:174:68: error: ‘std::tr1’ has not been declared
template struct HasTrivialDestructor : public std::tr1::has_trivial_destructor { };
^~~
../3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h:174:73: error: expected ‘{’ before ‘has_trivial_destructor’
template struct HasTrivialDestructor : public std::tr1::has_trivial_destructor { };
^~~~~~~~~~~~~~~~~~
In file included from ../3rdparty/javascriptcore/JavaScriptCore/wtf/VectorTraits.h:24:0,
from ../3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:27,
from ../3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_exec.cpp:50:
../3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtr.h:43:21: warning: ‘template class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
OwnPtr(std::auto_ptr autoPtr) : m_ptr(autoPtr.release()) { }
^~~~
In file included from /usr/include/c++/7/memory:80:0,
from ../3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtr.h:29,
from ../3rdparty/javascriptcore/JavaScriptCore/wtf/VectorTraits.h:24,
from ../3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:27,
from ../3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_exec.cpp:50:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
template class auto_ptr;
^~~~
In file included from ../3rdparty/javascriptcore/JavaScriptCore/wtf/VectorTraits.h:24:0,
from ../3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:27,
from ../3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_exec.cpp:50:
../3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtr.h:61:25: warning: ‘template class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
void adopt(std::auto_ptr autoPtr) { ASSERT(!autoPtr.get() || m_ptr != autoPtr.get()); deleteOwnedPtr(m_ptr); m_ptr = autoPtr.release(); }
^~~~
In file included from /usr/include/c++/7/memory:80:0,
from ../3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtr.h:29,
from ../3rdparty/javascriptcore/JavaScriptCore/wtf/VectorTraits.h:24,
from ../3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:27,
from ../3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_exec.cpp:50:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
template class auto_ptr;
^~~~
In file included from ../3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:27:0,
from ../3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_exec.cpp:50:
../3rdparty/javascriptcore/JavaScriptCore/wtf/VectorTraits.h:84:30: warning: ‘template class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
struct VectorTraits

解决:

https://blog.youkuaiyun.com/baidu_33850454/article/details/79147161

这里写图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值