关于arm-himix100-linux交叉编译器编译qt5.15.2时遇到tools/qline.cpp:587:16: error: ‘std::hypot‘ has not been的问题

打开报错文件的相应位置,改为如下代码

qreal QLineF::length() const

{

    // using std::hypot;

    return hypot(dx(), dy());

}

后面还有几个类似错误,都是由std::导致的,相应代码删掉或注释掉报错的std::就行。

例如qt源码中

float applyInverseExtended(float x) const

    {

        if (x >= 0.0f && x <= 1.0f)

            return applyInverse(x);

        if (m_type == Type::Function)

            // return std::copysign(applyInverse(x), x);

            return copysign(applyInverse(x), x);

        if (m_type == Type::Table)

            return x < 0.0f ? 0.0f : 1.0f;

        return x;

    }

static inline bool canUseFastMatrixPath(const qreal cx, const qreal cy, const qsizetype length, const QSpanData *data)

{

    if (Q_UNLIKELY(!data->fast_matrix))

        return false;

    qreal fx = (data->m21 * cy + data->m11 * cx + data->dx) * fixed_scale;

    qreal fy = (data->m22 * cy + data->m12 * cx + data->dy) * fixed_scale;

    qreal minc = std::min(fx, fy);

    qreal maxc = std::max(fx, fy);

    // fx += std::trunc(data->m11 * fixed_scale) * length;

    // fy += std::trunc(data->m12 * fixed_scale) * length;

    fx += trunc(data->m11 * fixed_scale) * length;

    fy += trunc(data->m12 * fixed_scale) * length;

    minc = std::min(minc, std::min(fx, fy));

    maxc = std::max(maxc, std::max(fx, fy));

    return minc >= std::numeric_limits<int>::min() && maxc <= std::numeric_limits<int>::max();

}

int QRhi::mipLevelsForSize(const QSize &size) const

{

    // return qFloor(std::log2(qMax(size.width(), size.height()))) + 1;

    return qFloor(log2(qMax(size.width(), size.height()))) + 1;

}

ReturnedValue MathObject::method_trunc(const FunctionObject *, const Value *, const Value *argv, int argc)

{

    double v = argc ? argv[0].toNumber() : qt_qnan();

#ifdef Q_OS_ANDROID // incomplete std :-(

    if (std::isnan(v) || qt_is_inf(v) || qIsNull(v))

        RETURN_RESULT(Encode(v));

    // Nearest integer not greater in magnitude:

    quint64 whole = std::abs(v);

    RETURN_RESULT(Encode(copySign(whole, v)));

#else

    // RETURN_RESULT(Encode(std::trunc(v)));

    RETURN_RESULT(Encode(trunc(v)));

#endif

}

还有些就不依次列举了

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值