Page 1 of 1

Error when building most recent git build

Posted: 2020-05-27, 03:48
by applsaucy

Code: Select all

Libs/Models/Loader_mdl_hl1.cpp: In member function 'void LoaderHL1mdlT::Load(ArrayT<CafuModelT::JointT>&) const':
Libs/Models/Loader_mdl_hl1.cpp:204:45: error: taking address of packed member of 'StudioBoneT' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  204 |         const MatrixT         Mat(Vector3fT(&Bone.Value[0]), cf::math::QuaternionfT::Euler(Bone.Value[4], Bone.Value[5], Bone.Value[3]));
      |                                             ^~~~~~~~~~~~~~
Libs/Models/Loader_mdl_hl1.cpp: In member function 'void LoaderHL1mdlT::Load(ArrayT<CafuModelT::AnimT>&) const':
Libs/Models/Loader_mdl_hl1.cpp:412:58: error: taking address of packed member of 'StudioBoneT' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  412 |                 AllData[BoneNr][FrameNr].Pos = Vector3fT(&StudioBones[BoneNr].Value[0]);
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Libs/Models/Loader_mdl_hl1.cpp:413:58: error: taking address of packed member of 'StudioBoneT' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  413 |                 AllData[BoneNr][FrameNr].Ang = Vector3fT(&StudioBones[BoneNr].Value[3]);
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Libs/Models/Loader_mdl_hl1.cpp:514:67: error: taking address of packed member of 'StudioSequenceT' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  514 |             Anim.Frames[FrameNr].BB=BoundingBox3fT(Vector3fT(Sequ.BBMin), Vector3fT(Sequ.BBMax));
      |                                                              ~~~~~^~~~~
Libs/Models/Loader_mdl_hl1.cpp:514:90: error: taking address of packed member of 'StudioSequenceT' may result in an unaligned pointer value [-Werror=address-of-packed-member]
  514 |             Anim.Frames[FrameNr].BB=BoundingBox3fT(Vector3fT(Sequ.BBMin), Vector3fT(Sequ.BBMax));
      |                                                                                     ~~~~~^~~~~
cc1plus: all warnings being treated as errors
scons: *** [Libs/build/linux/g++/release/Models/Loader_mdl_hl1.o] Error 1
scons: building terminated because of errors.
I'm running up-to-date archlinux with gcc 10.0

Re: Error when building most recent git build

Posted: 2020-05-29, 21:06
by Carsten
Dear applsaucy,
welcome to the Cafu forums! :welcome:

Unfortunately, in the recent years I've had very little spare time for the further development and maintenance of Cafu, so I cannot fix this problem at it's root quickly. However, you may try removing the -Werror flags in the SConstruct file in the main directory (lines 604 to 606). This will no longer treat warnings as errors and the compile should succeed.