intel / riggingtools

Collection of tools bridging the gap between 3D skeletal tracking and animation
MIT License
33 stars 9 forks source link

code build issue #9

Closed rbruga closed 3 years ago

rbruga commented 3 years ago

recognize the build error below?

Partial cmake output with compiler versions and checks:

-- The C compiler identification is GNU 6.5.0
-- The CXX compiler identification is GNU 6.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works

make output showing error (using master)

[  2%] Building CXX object rig2c/CMakeFiles/rig2c.dir/src/rig2c.cpp.o
In file included from 
.../riggingtools/rig2c/src/rig2c.cpp:10:0:
.../riggingtools/rig2c/../common/Rig.hpp:233:22: error: enclosing class of constexpr non-static member function ‘Joint& Rig::GetJoint(Rig::JOINT_TYPE)’ is not a literal type
    constexpr Joint & GetJoint( JOINT_TYPE type )
                      ^~~~~~~~
.../riggingtools/rig2c/../common/Rig.hpp:62:8: note: ‘Rig’ is not literal because:
 struct Rig
        ^~~
.../riggingtools/rig2c/../common/Rig.hpp:62:8: note:   ‘Rig’ is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor
.../riggingtools/rig2c/../common/Rig.hpp:260:28: error: enclosing class of constexpr non-static member function ‘const Joint& Rig::GetJoint(Rig::JOINT_TYPE) const’ is not a literal type
    constexpr const Joint & GetJoint( JOINT_TYPE type ) const { return const_cast< Rig * >(this)->GetJoint( type ); }
                            ^~~~~~~~
.../riggingtools/rig2c/../common/Rig.hpp:261:26: error: enclosing class of constexpr non-static member function ‘JointOffset Rig::GetJointOffset(Rig::JOINT_OFFSET_TYPE)’ is not a literal type
    constexpr JointOffset GetJointOffset( JOINT_OFFSET_TYPE type )
                          ^~~~~~~~~~~~~~
.../riggingtools/rig2c/../common/Rig.hpp:272:32: error: enclosing class of constexpr non-static member function ‘const JointOffset Rig::GetJointOffset(Rig::JOINT_OFFSET_TYPE) const’ is not a literal type
    constexpr const JointOffset GetJointOffset( JOINT_OFFSET_TYPE type ) const { return const_cast< Rig * >(this)->GetJointOffset( type ); }
                                ^~~~~~~~~~~~~~
johnhe4 commented 3 years ago

I haven't seen this before. It may be caused by an old GCC compiler which is known for not handling C++14 correctly: https://stackoverflow.com/questions/36489369/constexpr-non-static-member-function-with-non-constexpr-constructor-gcc-clang-d

johnhe4 commented 3 years ago

@rbruga Can you try GNU compiler version 7.2 or later? Current stable version is 10.2, I've been testing on 9.x

rbruga commented 3 years ago

@johnhe4 Updated to GCC-7 and G++7 (7.5.0) and there is no error now. Thanks! Requirements list says GCC 6.5 minimum, that will need to get updated.

prachi9 commented 3 years ago

If you have multiple gcc and g++ versions on the machine and it is picking an older one, try: export CC=/path/to/newer/gcc export CXX=/path/to/newer/g++ cmake .. make