HM16.20 編譯出現 memcpy error 處理

In file included from /storage/linux/src/hm/build/linux/lib/TLibCommon/../../../../source/Lib/TLibCommon/ContextModel3DBuffer.cpp:38:
/storage/linux/src/hm/build/linux/lib/TLibCommon/../../../../source/Lib/TLibCommon/ContextModel3DBuffer.h: In member function ‘Void ContextModel3DBuffer::copyFrom(const ContextModel3DBuffer*)’:
/storage/linux/src/hm/build/linux/lib/TLibCommon/../../../../source/Lib/TLibCommon/ContextModel3DBuffer.h:91:85: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class ContextModel’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
     ::memcpy( m_contextModel, src->m_contextModel, sizeof(ContextModel) * m_sizeXYZ );
                                                                                     ^
In file included from /storage/linux/src/hm/build/linux/lib/TLibCommon/../../../../source/Lib/TLibCommon/ContextModel3DBuffer.h:45,
                 from /storage/linux/src/hm/build/linux/lib/TLibCommon/../../../../source/Lib/TLibCommon/ContextModel3DBuffer.cpp:38:
/storage/linux/src/hm/build/linux/lib/TLibCommon/../../../../source/Lib/TLibCommon/ContextModel.h:57:7: note: ‘class ContextModel’ declared here
 class ContextModel
       ^~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [../../common/makefile.base:241: objects/ContextModel3DBuffer.r.o] Error 1
make[1]: Leaving directory '/storage/linux/src/hm/build/linux/lib/TLibCommon'
make: *** [makefile:49: release] Error 2

 

主要是因爲在gcc8下編譯會有問題,請將 build/linux/common/makefile.base裏面的 -Werror 去掉即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章