[英]qendian.h:219: error: undefined reference to `char* qbswap<char*>(char*)'
I encountered this error while trying to use qFromBigEndian.我在尝试使用 qFromBigEndian 时遇到了这个错误。
QByteArray message = ...;
qDebug() << qFromBigEndian(message.data());
The error is:错误是:
qendian.h:219: error: undefined reference to `char* qbswap<char*>(char*)'
Why am I getting this error?为什么我会收到此错误?
From reading https://www.qtcentre.org/threads/18728-qFromBigEndian(-)-not-found , it seems I need to specify the type explicitly.从阅读https://www.qtcentre.org/threads/18728-qFromBigEndian(-)-not-found ,看来我需要明确指定类型。
qDebug() << qFromBigEndian<uint32_t>(message.data());
instead of代替
qDebug() << qFromBigEndian(message.data());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.