CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   compile error when playing with OpenFOAM test cases (https://www.cfd-online.com/Forums/openfoam-programming-development/180004-compile-error-when-playing-openfoam-test-cases.html)

TimLiu November 14, 2016 13:13

compile error when playing with OpenFOAM test cases
 
Dear OpenFoam users,

I was just playing with some test cases in the OpenFOAM directory $WM_PROJECT_DIR/applications/test/mesh.

When I was trying to compile the Test-mesh.C file by typing wmake in the terminal. It gives me a lot of errors (see attached compile log). I am quite a new user of OpenFoam and I don't know how to solve this problem.

Can anyone help me ?

Many Thanks,
Zheng







/opt/openfoam4/applications/test/mesh
g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam4/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c Test-mesh.C -o /opt/openfoam4/platforms/linux64GccDPInt32Opt/applications/test/mesh/Test-mesh.o
In file included from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricScalarField.H:38:0,
from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricFields.H:34,
from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:37,
from Test-mesh.C:28:
/opt/openfoam4/src/OpenFOAM/lnInclude/GeometricField.H:81:1: error: template class without a name
class
^
In file included from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricField.H:649:0,
from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricFields.H:34,
from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:37,
from Test-mesh.C:28:
/opt/openfoam4/src/OpenFOAM/lnInclude/GeometricFieldI.H:30:55: error: invalid use of incomplete type ‘class Foam::GeometricField<Type, PatchField, GeoMesh>’
Foam::GeometricField<Type, PatchField, GeoMesh>::null()
^
In file included from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolation.H:40:0,
from /opt/openfoam4/src/finiteVolume/lnInclude/fvMesh.H:54,
from Test-mesh.C:27:
/opt/openfoam4/src/finiteVolume/lnInclude/volFieldsFwd.H:52:7: note: declaration of ‘class Foam::GeometricField<Type, PatchField, GeoMesh>’
class GeometricField;
^
In file included from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricField.H:649:0,
from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricFields.H:34,
from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:37,
from Test-mesh.C:28:
/opt/openfoam4/src/OpenFOAM/lnInclude/GeometricFieldI.H:41:17: error: invalid use of incomplete type ‘class Foam::GeometricField<Type, PatchField, GeoMesh>’
internalField() const
^
In file included from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolation.H:40:0,
from /opt/openfoam4/src/finiteVolume/lnInclude/fvMesh.H:54,
from Test-mesh.C:27:
/opt/openfoam4/src/finiteVolume/lnInclude/volFieldsFwd.H:52:7: note: declaration of ‘class Foam::GeometricField<Type, PatchField, GeoMesh>’
class GeometricField;
^
In file included from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricField.H:649:0,
from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricFields.H:34,
from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:37,
from Test-mesh.C:28:
/opt/openfoam4/src/OpenFOAM/lnInclude/GeometricFieldI.H:51:67: error: invalid use of incomplete type ‘class Foam::GeometricField<Type, PatchField, GeoMesh>’
Foam::GeometricField<Type, PatchField, GeoMesh>::primitiveField() const
^
In file included from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolation.H:40:0,
from /opt/openfoam4/src/finiteVolume/lnInclude/fvMesh.H:54,
from Test-mesh.C:27:
/opt/openfoam4/src/finiteVolume/lnInclude/volFieldsFwd.H:52:7: note: declaration of ‘class Foam::GeometricField<Type, PatchField, GeoMesh>’
class GeometricField;
^
In file included from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricField.H:649:0,
from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricScalarField.H:38,
from /opt/openfoam4/src/OpenFOAM/lnInclude/GeometricFields.H:34,
from /opt/openfoam4/src/finiteVolume/lnInclude/volFields.H:37,
from Test-mesh.C:28:
/opt/openfoam4/src/OpenFOAM/lnInclude/GeometricFieldI.H:60:66: error: invalid use of incomplete type ‘class Foam::GeometricField<Type, PatchField, GeoMesh>’
Foam::GeometricField<Type, PatchField, GeoMesh>::boundaryField() const
^
In file included from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolation.H:40:0,
from /opt/openfoam4/src/finiteVolume/lnInclude/fvMesh.H:54,
from Test-mesh.C:27:
/opt/openfoam4/src/finiteVolume/lnInclude/volFieldsFwd.H:52:7: note: declaration of ‘class Foam::GeometricField<Type, PatchField, GeoMesh>’
class GeometricField;
^



...

...

...




/opt/openfoam4/src/OpenFOAM/lnInclude/GeometricField.C: In instantiation of ‘Foam::Ostream& Foam::operator<<(Foam::Ostream&, const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = Foam::Vector<double>; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]’:
Test-mesh.C:56:19: required from here
/opt/openfoam4/src/OpenFOAM/lnInclude/GeometricField.C:1271:7: error: no match for call to ‘(const Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>) ()’
gf().writeData(os, "internalField");
^
/opt/openfoam4/src/OpenFOAM/lnInclude/GeometricField.C:1273:5: error: invalid use of incomplete type ‘const class Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>’
gf.boundaryField().writeEntry("boundaryField", os);
^
In file included from /opt/openfoam4/src/finiteVolume/lnInclude/surfaceInterpolation.H:40:0,
from /opt/openfoam4/src/finiteVolume/lnInclude/fvMesh.H:54,
from Test-mesh.C:27:
/opt/openfoam4/src/finiteVolume/lnInclude/volFieldsFwd.H:52:7: note: declaration of ‘class Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>’
class GeometricField;
^
make: *** [/opt/openfoam4/platforms/linux64GccDPInt32Opt/applications/test/mesh/Test-mesh.o] Error 1

TimLiu November 14, 2016 14:35

I solved this problem by simply reinstall the OpenFOAM. :)


All times are GMT -4. The time now is 00:29.