SMESH building errors and warnings using msys2 with MinGW

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Yasser
Posts: 35
Joined: Tue Dec 15, 2020 4:28 pm

SMESH building errors and warnings using msys2 with MinGW

Post by Yasser »

Hello,
During building ( --Build) in msys2 with MinGW
a lot of errors shows up and most of it came from the SMESH module in different error types
for a start the building ended with this text

Code: Select all

[138/4251] Linking CXX shared library bin\libSMESH.dll
ninja: build stopped: subcommand failed.
there was other types of smesh errors
like this

Code: Select all

C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MeshEditor.hxx:106:32: error: function 'SMESH_MeshEditor::ElemFeatures& SMESH_MeshEditor::ElemFeatures::SetID(int)' definition is marked dllimport
  106 |     SMESH_EXPORT ElemFeatures& SetID  (int ID)      { myID = ID; return *this; }
      |                                ^~~~~
and this

Code: Select all

C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MeshEditor.hxx:85:18: error: function 'SMESH_MeshEditor::ElemFeatures::ElemFeatures(SMDSAbs_ElementType, bool, bool)' definition is marked dllimport
   85 |     SMESH_EXPORT ElemFeatures( SMDSAbs_ElementType type=SMDSAbs_All, bool isPoly=false, bool isQuad=false )
      |                  ^~~~~~~~~~~~
and this is a complete part

Code: Select all

[136/4251] Building CXX object src/3rdParty/salomesmesh/CMakeFiles/StdMeshers.dir/src/StdMeshers/StdMeshers_Cartesian_3D.cpp.obj
FAILED: src/3rdParty/salomesmesh/CMakeFiles/StdMeshers.dir/src/StdMeshers/StdMeshers_Cartesian_3D.cpp.obj
C:\msys64\mingw64\bin\c++.exe -DCSFDB -DHAVE_CONFIG_H -DHAVE_SNPRINTF -DStdMeshers_EXPORTS -DWIN32 -DWNT -D_OCC64 -D_WINDOWS -IC:/msys64/home/Baba/Build -IC:/msys64/home/Baba/Build/src -IC:/msys64/home/Baba/FreeCAD/src -IC:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/src/SMDS -IC:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/src/Driver -IC:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/src/DriverUNV -IC:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/src/DriverDAT -IC:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/src/DriverSTL -IC:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/src/StdMeshers -IC:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc -IC:/msys64/home/Baba/Build/src/3rdParty/salomesmesh -IC:/msys64/mingw64/include/opencascade -IC:/msys64/mingw64/include/double-conversion -IC:/msys64/mingw64/include/eigen3 -IC:/msys64/mingw64/include/freetype2 -isystem C:/msys64/mingw64/include/vtk-8.2 -Wall -Wextra -Wno-write-strings  -Wno-attributes -Wno-sign-compare -Wno-reorder -Wno-switch -Wno-unused-variable -Wno-unused-but-set-variable -Wno-comment -Wno-unused-parameter -Wno-empty-body -Wno-pedantic -Wno-unused-result -Wno-cast-function-type -Wno-maybe-uninitialized -Wno-missing-field-initializers -DSTDMESHERS_EXPORTS -DSMESHUtils_EXPORTS -std=gnu++17 -MD -MT src/3rdParty/salomesmesh/CMakeFiles/StdMeshers.dir/src/StdMeshers/StdMeshers_Cartesian_3D.cpp.obj -MF src\3rdParty\salomesmesh\CMakeFiles\StdMeshers.dir\src\StdMeshers\StdMeshers_Cartesian_3D.cpp.obj.d -o src/3rdParty/salomesmesh/CMakeFiles/StdMeshers.dir/src/StdMeshers/StdMeshers_Cartesian_3D.cpp.obj -c C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Cartesian_3D.cpp
In file included from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx:36,
                 from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMDS_MeshNode.hxx:32,
                 from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_Algo.hxx:33,
                 from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/StdMeshers_Cartesian_3D.hxx:31,
                 from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Cartesian_3D.cpp:32:
C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMDS_StdIterator.hxx:37:38: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
   37 | class SMDS_StdIterator : public std::iterator< std::input_iterator_tag, VALUE >
      |                                      ^~~~~~~~
In file included from C:/msys64/mingw64/include/c++/12.1.0/bits/stl_algobase.h:65,
                 from C:/msys64/mingw64/include/c++/12.1.0/memory:63,
                 from C:/msys64/mingw64/include/boost/smart_ptr/detail/sp_counted_impl.hpp:35,
                 from C:/msys64/mingw64/include/boost/smart_ptr/detail/shared_count.hpp:27,
                 from C:/msys64/mingw64/include/boost/smart_ptr/shared_ptr.hpp:17,
                 from C:/msys64/mingw64/include/boost/shared_ptr.hpp:17,
                 from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMDS_ElemIterator.hxx:33,
                 from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx:34:
C:/msys64/mingw64/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
In file included from C:/msys64/mingw64/include/vtk-8.2/vtkAtomic.h:28,
                 from C:/msys64/mingw64/include/vtk-8.2/vtkAtomicTypes.h:18,
                 from C:/msys64/mingw64/include/vtk-8.2/vtkObjectBase.h:54,
                 from C:/msys64/mingw64/include/vtk-8.2/vtkObject.h:45,
                 from C:/msys64/mingw64/include/vtk-8.2/vtkCellArray.h:39,
                 from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMDS_MeshElement.hxx:43:
C:/msys64/mingw64/include/tbb/atomic.h:21:141: note: '#pragma message: TBB Warning: tbb/atomic.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.'
   21 | #pragma message("TBB Warning: tbb/atomic.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.")
      |                                                                                                                                             ^
In file included from C:/msys64/mingw64/include/opencascade/NCollection_IndexedDataMap.hxx:23,
                 from C:/msys64/mingw64/include/opencascade/Standard_Dump.hxx:17,
                 from C:/msys64/mingw64/include/opencascade/NCollection_Vec2.hxx:20,
                 from C:/msys64/mingw64/include/opencascade/NCollection_Vec3.hxx:20,
                 from C:/msys64/mingw64/include/opencascade/NCollection_Vec4.hxx:18,
                 from C:/msys64/mingw64/include/opencascade/NCollection_Mat4.hxx:19,
                 from C:/msys64/mingw64/include/opencascade/gp_Trsf.hxx:21,
                 from C:/msys64/mingw64/include/opencascade/TopLoc_ItemLocation.hxx:26,
                 from C:/msys64/mingw64/include/opencascade/TopLoc_Location.lxx:18,
                 from C:/msys64/mingw64/include/opencascade/TopLoc_Location.hxx:179,
                 from C:/msys64/mingw64/include/opencascade/TopoDS_Shape.hxx:24,
                 from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_Algo.hxx:39:
C:/msys64/mingw64/include/opencascade/NCollection_StlIterator.hxx:30:15: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
   30 |   public std::iterator<Category, ItemType, ptrdiff_t,
      |               ^~~~~~~~
C:/msys64/mingw64/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
In file included from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MesherHelper.hxx:32,
                 from C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Cartesian_3D.cpp:38:
C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MeshEditor.hxx:85:18: error: function 'SMESH_MeshEditor::ElemFeatures::ElemFeatures(SMDSAbs_ElementType, bool, bool)' definition is marked dllimport
   85 |     SMESH_EXPORT ElemFeatures( SMDSAbs_ElementType type=SMDSAbs_All, bool isPoly=false, bool isQuad=false )
      |                  ^~~~~~~~~~~~
C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MeshEditor.hxx:88:32: error: function 'SMESH_MeshEditor::ElemFeatures& SMESH_MeshEditor::ElemFeatures::Init(SMDSAbs_ElementType, bool, bool)' definition is marked dllimport
   88 |     SMESH_EXPORT ElemFeatures& Init( SMDSAbs_ElementType type, bool isPoly=false, bool isQuad=false )
      |                                ^~~~
C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MeshEditor.hxx:93:32: error: function 'SMESH_MeshEditor::ElemFeatures& SMESH_MeshEditor::ElemFeatures::Init(double)' definition is marked dllimport
   93 |     SMESH_EXPORT ElemFeatures& Init( double diameter )
      |                                ^~~~
C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MeshEditor.hxx:96:32: error: function 'SMESH_MeshEditor::ElemFeatures& SMESH_MeshEditor::ElemFeatures::Init(std::vector<int>&, bool)' definition is marked dllimport
   96 |     SMESH_EXPORT ElemFeatures& Init( std::vector<int>& quanities, bool isQuad=false )
      |                                ^~~~
C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MeshEditor.hxx:100:32: error: function 'SMESH_MeshEditor::ElemFeatures& SMESH_MeshEditor::ElemFeatures::Init(const std::vector<int>&, bool)' definition is marked dllimport
  100 |     SMESH_EXPORT ElemFeatures& Init( const std::vector<int>& quanities, bool isQuad=false )
      |                                ^~~~
C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MeshEditor.hxx:104:32: error: function 'SMESH_MeshEditor::ElemFeatures& SMESH_MeshEditor::ElemFeatures::SetPoly(bool)' definition is marked dllimport
  104 |     SMESH_EXPORT ElemFeatures& SetPoly(bool isPoly) { myIsPoly = isPoly; return *this; }
      |                                ^~~~~~~
C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MeshEditor.hxx:105:32: error: function 'SMESH_MeshEditor::ElemFeatures& SMESH_MeshEditor::ElemFeatures::SetQuad(bool)' definition is marked dllimport
  105 |     SMESH_EXPORT ElemFeatures& SetQuad(bool isQuad) { myIsQuad = isQuad; return *this; }
      |                                ^~~~~~~
C:/msys64/home/Baba/FreeCAD/src/3rdParty/salomesmesh/inc/SMESH_MeshEditor.hxx:106:32: error: function 'SMESH_MeshEditor::ElemFeatures& SMESH_MeshEditor::ElemFeatures::SetID(int)' definition is marked dllimport
  106 |     SMESH_EXPORT ElemFeatures& SetID  (int ID)      { myID = ID; return *this; }
      |                                ^~~~~
i guess this is something related to a directory or library issue.
if anyone can help i'll appreciate that
thanks
Last edited by Yasser on Tue Jun 14, 2022 7:29 pm, edited 1 time in total.
They call me Baba, the bug master :D
Let us throw some stones into still waters
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: SMESH building errors and warninngs

Post by Gift »

In the first step you can disable FEM:

Code: Select all

cmake -DCMAKE_PREFIX_PATH=/mingw64/lib/cmake/ -DBUILD_FEM=OFF ../FreeCAD
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: SMESH building errors and warnings

Post by Gift »

User avatar
Yasser
Posts: 35
Joined: Tue Dec 15, 2020 4:28 pm

Re: SMESH building errors and warninngs

Post by Yasser »

Gift wrote: Tue Jun 14, 2022 6:35 pm In the first step you can disable FEM:

Code: Select all

cmake -DCMAKE_PREFIX_PATH=/mingw64/lib/cmake/ -DBUILD_FEM=OFF ../FreeCAD
This is very nice from you, thank you
i'll do it.
They call me Baba, the bug master :D
Let us throw some stones into still waters
Post Reply