![](/img/trans.png)
[英]How to convert cv::Mat to dlib::array2d<uint16_t> ,and typedef unsigned short int uint16_t
[英]Casting error converting from unsigned int to uint16_t
為什么會出現此錯誤
1> c:\\ users \\ g \\ documents \\ Visual Studio 2012 \\ projects \\ tlvdemo \\ tlvdemo \\ tlvobject.cpp(50):錯誤C2440:'type cast':無法從'unsigned int(__thiscall std :: basic_string <_Elem ,_Traits,_Alloc> :: *)(void)throw()const'到'uint16_t'
以及如何解決?
碼
uint16_t tagLen = (uint16_t)m_tagName.length; //m_tagName is string type
問題在於您調用length
方法的方式。
您必須使用m_tagName.length();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.