Last commit 0.19dev does not compile

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
user1234
Veteran
Posts: 3512
Joined: Mon Jul 11, 2016 5:08 pm

Last commit 0.19dev does not compile

Post by user1234 »

Hello!

The last commit does not compile.

e981537

Code: Select all

In file included from /home/laptop/Programs/FreeCAD/sourcecode/src/Gui/Utilities.h:27,
                 from /home/laptop/Programs/FreeCAD/sourcecode/src/Gui/Utilities.cpp:34:
/home/laptop/Programs/FreeCAD/sourcecode/src/Base/Converter.h: In function ‘_Vec1 Base::convertTo(const _Vec2&)’:
/home/laptop/Programs/FreeCAD/sourcecode/src/Base/Converter.h:102:12: error: parse error in template argument list
     return make_vec<_Vec1, typename float_type>(std::move(tuple));
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/build.make:1570: src/Gui/CMakeFiles/FreeCADGui.dir/Utilities.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5754: src/Gui/CMakeFiles/FreeCADGui.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Greetings
user
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Last commit 0.19dev does not compile

Post by wmayer »

Does it work to replace

Code: Select all

return make_vec<_Vec1, typename float_type>(std::move(tuple));
with

Code: Select all

return make_vec<_Vec1, float_type>(std::move(tuple));
i.e. to remove the typename?
user1234
Veteran
Posts: 3512
Joined: Mon Jul 11, 2016 5:08 pm

Re: Last commit 0.19dev does not compile

Post by user1234 »

Yes!

Thanks!
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Last commit 0.19dev does not compile

Post by wmayer »

Pushed fix to master.
sanderboer
Posts: 26
Joined: Fri Aug 30, 2019 9:47 am

Re: Last commit 0.19dev does not compile

Post by sanderboer »

I have almost the same error on today's commit:

Code: Select all

nfs/Projects/Github/freecad_sndr/src/Gui/Utilities.h: In member function 'std::tuple<float, float, float, float> Base::vec_traits<SbRotation>::get() const':
/nfs/Projects/Github/freecad_sndr/src/Gui/Utilities.h:73:33: error: no match for 'operator[]' (operand types are 'const vec_type' {aka 'const SbRotation'} and 'int')
   73 |         return std::make_tuple(v[0], v[1], v[2], v[3]);
      |                                 ^
/nfs/Projects/Github/freecad_sndr/src/Gui/Utilities.h:73:39: error: no match for 'operator[]' (operand types are 'const vec_type' {aka 'const SbRotation'} and 'int')
   73 |         return std::make_tuple(v[0], v[1], v[2], v[3]);
      |                                       ^
/nfs/Projects/Github/freecad_sndr/src/Gui/Utilities.h:73:45: error: no match for 'operator[]' (operand types are 'const vec_type' {aka 'const SbRotation'} and 'int')
   73 |         return std::make_tuple(v[0], v[1], v[2], v[3]);
      |                                             ^
/nfs/Projects/Github/freecad_sndr/src/Gui/Utilities.h:73:51: error: no match for 'operator[]' (operand types are 'const vec_type' {aka 'const SbRotation'} and 'int')
   73 |         return std::make_tuple(v[0], v[1], v[2], v[3]);
      |                                                   ^
make[2]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/build.make:1574: src/Gui/CMakeFiles/FreeCADGui.dir/Utilities.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5089: src/Gui/CMakeFiles/FreeCADGui.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Last commit 0.19dev does not compile

Post by wmayer »

I have almost the same error on today's commit:
Maybe can you upload the content of the file SbRotation.h? It looks like your version of SbRotation lacks of the [] operator.
hinckel
Posts: 113
Joined: Fri Nov 21, 2014 11:45 am
Location: SJCAMPOS, SP - BR

Re: Last commit 0.19dev does not compile

Post by hinckel »

problem persists....

Code: Select all

In file included from /home/hinckel/FreeCAD/FreeCAD/src/Gui/Utilities.cpp:34:0:
/home/hinckel/FreeCAD/FreeCAD/src/Gui/Utilities.h: In member function ‘std::tuple<float, float, float, float> Base::vec_traits<SbRotation>::get() const’:
/home/hinckel/FreeCAD/FreeCAD/src/Gui/Utilities.h:73:33: error: no match for ‘operator[]’ (operand types are ‘const vec_type {aka const SbRotation}’ and ‘int’)
         return std::make_tuple(v[0], v[1], v[2], v[3]);
                                 ^
/home/hinckel/FreeCAD/FreeCAD/src/Gui/Utilities.h:73:39: error: no match for ‘operator[]’ (operand types are ‘const vec_type {aka const SbRotation}’ and ‘int’)
         return std::make_tuple(v[0], v[1], v[2], v[3]);
                                       ^
/home/hinckel/FreeCAD/FreeCAD/src/Gui/Utilities.h:73:45: error: no match for ‘operator[]’ (operand types are ‘const vec_type {aka const SbRotation}’ and ‘int’)
         return std::make_tuple(v[0], v[1], v[2], v[3]);
                                             ^
/home/hinckel/FreeCAD/FreeCAD/src/Gui/Utilities.h:73:51: error: no match for ‘operator[]’ (operand types are ‘const vec_type {aka const SbRotation}’ and ‘int’)
         return std::make_tuple(v[0], v[1], v[2], v[3]);

Code: Select all

# file SbRotation.h
#ifndef COIN_SBROTATION_H
#define COIN_SBROTATION_H

/**************************************************************************\
 *
 *  This file is part of the Coin 3D visualization library.
 *  Copyright (C) by Kongsberg Oil & Gas Technologies.
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  ("GPL") version 2 as published by the Free Software Foundation.
 *  See the file LICENSE.GPL at the root directory of this source
 *  distribution for additional information about the GNU GPL.
 *
 *  For using Coin with software that can not be combined with the GNU
 *  GPL, and for taking advantage of the additional benefits of our
 *  support services, please contact Kongsberg Oil & Gas Technologies
 *  about acquiring a Coin Professional Edition License.
 *
 *  See http://www.coin3d.org/ for more information.
 *
 *  Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
 *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
 *
\**************************************************************************/

#include <stdio.h>
#include <Inventor/SbVec4f.h>

class SbMatrix;
class SbVec3f;

class COIN_DLL_API SbRotation {
public:
  SbRotation(void);
  SbRotation(const SbVec3f & axis, const float radians);
  SbRotation(const float q[4]);
  SbRotation(const float q0, const float q1, const float q2, const float q3);
  SbRotation(const SbMatrix & m);
  SbRotation(const SbVec3f & rotateFrom, const SbVec3f & rotateTo);
  const float * getValue(void) const;
  void getValue(float & q0, float & q1, float & q2, float & q3) const;
  SbRotation & setValue(const float q0, const float q1,
                        const float q2, const float q3);
  void getValue(SbVec3f & axis, float & radians) const;
  void getValue(SbMatrix & matrix) const;
  SbRotation & invert(void);
  SbRotation inverse(void) const;
  SbRotation & setValue(const float q[4]);
  SbRotation & setValue(const SbMatrix & m);
  SbRotation & setValue(const SbVec3f & axis, const float radians);
  SbRotation & setValue(const SbVec3f & rotateFrom, const SbVec3f & rotateTo);
  SbRotation & operator*=(const SbRotation & q);
  SbRotation & operator*=(const float s);
  friend COIN_DLL_API int operator==(const SbRotation & q1, const SbRotation & q2);
  friend COIN_DLL_API int operator!=(const SbRotation & q1, const SbRotation & q2);
  SbBool equals(const SbRotation & r, const float tolerance) const;
  friend COIN_DLL_API SbRotation operator *(const SbRotation & q1, const SbRotation & q2);
  void multVec(const SbVec3f & src, SbVec3f & dst) const;

  void scaleAngle(const float scaleFactor);
  static SbRotation slerp(const SbRotation & rot0, const SbRotation & rot1,
                          float t);
  static SbRotation identity(void);

  void print(FILE * fp) const;

private:
  SbVec4f quat;
};

COIN_DLL_API int operator ==(const SbRotation & q1, const SbRotation & q2);
COIN_DLL_API int operator !=(const SbRotation & q1, const SbRotation & q2);
COIN_DLL_API SbRotation operator *(const SbRotation & q1, const SbRotation & q2);

#endif // !COIN_SBROTATION_H

sanderboer
Posts: 26
Joined: Fri Aug 30, 2019 9:47 am

Re: Last commit 0.19dev does not compile

Post by sanderboer »

I am on Void Linux, Coin3 is version 3.1.3

I looked at the Coin bitbucket and it looks like a release error that got amended in Coin version 4.
I think this diff got mangled: https://bitbucket.org/Coin3D/coin/commi ... e82f528171

I dl-ed Coin-3.1.3.tar.gz and found that it has in fact this contents of SbRotation.h:

Code: Select all

#ifndef COIN_SBROTATION_H
#define COIN_SBROTATION_H

/**************************************************************************\
 *
 *  This file is part of the Coin 3D visualization library.
 *  Copyright (C) by Kongsberg Oil & Gas Technologies.
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  ("GPL") version 2 as published by the Free Software Foundation.
 *  See the file LICENSE.GPL at the root directory of this source
 *  distribution for additional information about the GNU GPL.
 *
 *  For using Coin with software that can not be combined with the GNU
 *  GPL, and for taking advantage of the additional benefits of our
 *  support services, please contact Kongsberg Oil & Gas Technologies
 *  about acquiring a Coin Professional Edition License.
 *
 *  See http://www.coin3d.org/ for more information.
 *
 *  Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
 *  http://www.sim.no/  sales@sim.no  coin-support@coin3d.org
 *
\**************************************************************************/

#include <stdio.h>
#include <Inventor/SbVec4f.h>

class SbMatrix;
class SbVec3f;

class COIN_DLL_API SbRotation {
public:
  SbRotation(void);
  SbRotation(const SbVec3f & axis, const float radians);
  SbRotation(const float q[4]);
  SbRotation(const float q0, const float q1, const float q2, const float q3);
  SbRotation(const SbMatrix & m);
  SbRotation(const SbVec3f & rotateFrom, const SbVec3f & rotateTo);
  const float * getValue(void) const;
  void getValue(float & q0, float & q1, float & q2, float & q3) const;
  SbRotation & setValue(const float q0, const float q1,
                        const float q2, const float q3);
  void getValue(SbVec3f & axis, float & radians) const;
  void getValue(SbMatrix & matrix) const;
  SbRotation & invert(void);
  SbRotation inverse(void) const;
  SbRotation & setValue(const float q[4]);
  SbRotation & setValue(const SbMatrix & m);
  SbRotation & setValue(const SbVec3f & axis, const float radians);
  SbRotation & setValue(const SbVec3f & rotateFrom, const SbVec3f & rotateTo);
  SbRotation & operator*=(const SbRotation & q);
  SbRotation & operator*=(const float s);
  friend COIN_DLL_API int operator==(const SbRotation & q1, const SbRotation & q2);
  friend COIN_DLL_API int operator!=(const SbRotation & q1, const SbRotation & q2);
  SbBool equals(const SbRotation & r, const float tolerance) const;
  friend COIN_DLL_API SbRotation operator *(const SbRotation & q1, const SbRotation & q2);
  void multVec(const SbVec3f & src, SbVec3f & dst) const;

  void scaleAngle(const float scaleFactor);
  static SbRotation slerp(const SbRotation & rot0, const SbRotation & rot1,
                          float t);
  static SbRotation identity(void);

  void print(FILE * fp) const;

private:
  SbVec4f quat;
};

COIN_DLL_API int operator ==(const SbRotation & q1, const SbRotation & q2);
COIN_DLL_API int operator !=(const SbRotation & q1, const SbRotation & q2);
COIN_DLL_API SbRotation operator *(const SbRotation & q1, const SbRotation & q2);

#endif // !COIN_SBROTATION_H

Last edited by sanderboer on Sun Sep 08, 2019 8:30 am, edited 1 time in total.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Last commit 0.19dev does not compile

Post by vocx »

sanderboer wrote: Sun Sep 08, 2019 7:38 am I am on Void Linux, Coin3 is version 3.1.3
FreeCAD uses Coin 4.0.0a.

This is actually an unreleased version, that FreeCAD developers patched and then submitted to Coin maintainers. Many Linux distributions carry in their repositories the old 3.1.3 version, I believe those based on Red Hat and Fedora, mostly. Therefore, you should try to get the latest Coin 4.0, and try to compile again.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Last commit 0.19dev does not compile

Post by wmayer »

Don't worry it's much easier to change the code inside FreeCAD to get the values of the quaternion. I guess building FreeCAD worked without problems until you encountered this issue. So, there is no reason to upgrade your Coin version.
Post Reply