I am trying to install openEMS on a Linux server (it has 4.18). Unfortunately I keep running into an error in one of the C++ files in CSXCAD that fails the make, and consequently the build, of openEMS on the server. I've tried to resolve the error but I am not fluent enough in C++ to fix it. These are the error lines that come up:
Code: Select all
[ 53%] Building CXX object src/CMakeFiles/CSXCAD.dir/CSPrimPolyhedronReader.cpp.o
/home/matlab/openEMS/CSXCAD/src/CSPrimPolyhedronReader.cpp: In member function 'virtual bool CSPrimPolyhedronReader::ReadFile()':
/home/matlab/openEMS/CSXCAD/src/CSPrimPolyhedronReader.cpp:167:34: error: cannot bind non-const lvalue reference of type 'const vtkIdType*&' {aka 'const long long int*&'} to an rvalue of type 'const vtkIdType*' {aka 'const long long int*'}
while (verts->GetNextCell(numP, const_cast<vtkIdType*>(vertices)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/vtk-9.0/vtkPolyData.h:68,
from /usr/local/include/vtk-9.0/vtkPolyDataAlgorithm.h:36,
from /usr/local/include/vtk-9.0/vtkAbstractPolyDataReader.h:34,
from /usr/local/include/vtk-9.0/vtkSTLReader.h:38,
from /home/matlab/openEMS/CSXCAD/src/CSPrimPolyhedronReader.cpp:24:
/usr/local/include/vtk-9.0/vtkCellArray.h:1419:12: note: initializing argument 2 of 'int vtkCellArray::GetNextCell(vtkIdType&, const vtkIdType*&)'
inline int vtkCellArray::GetNextCell(vtkIdType& npts, vtkIdType const*& pts) VTK_SIZEHINT(pts, npts)
^~~~~~~~~~~~
make[5]: *** [src/CMakeFiles/CSXCAD.dir/build.make:323: src/CMakeFiles/CSXCAD.dir/CSPrimPolyhedronReader.cpp.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:86: src/CMakeFiles/CSXCAD.dir/all] Error 2
make[3]: *** [Makefile:130: all] Error 2
make[2]: *** [CMakeFiles/CSXCAD.dir/build.make:112: CSXCAD-prefix/src/CSXCAD-stamp/CSXCAD-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:143: CMakeFiles/CSXCAD.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
Code: Select all
vtkIdType numP;
vtkIdType *vertices = new vtkIdType[10];
while (verts->GetNextCell(numP, vertices))
{
face f;
f.numVertex=numP;
f.vertices = new int[f.numVertex];
for (unsigned int np=0;np<f.numVertex;++np)
f.vertices[np]=vertices[np];
AddFace(f);
}
return true;
Thank you for your time