Hi to all
I am trying to execute c++ code which is used in OpenFoam software. Wheni execute it i am getting error:'namespace definition is not allowed here in .C as well as in .H file.Could any one help me in this regard.
Thanks in advance
Hi to all
I am trying to execute c++ code which is used in OpenFoam software. Wheni execute it i am getting error:'namespace definition is not allowed here in .C as well as in .H file.Could any one help me in this regard.
Thanks in advance
What is the C++ compiler that you are using? Post the smallest and simplest program that demonstrates the error.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Hi,
I am using Linux os with GNU compiler. I am trying to solve injector problem using OpenFoam software. In that i have to add boundary condition for that i have some .C and .H files Here are the files available in this link:
SourceForge.net Repository - [openfoam-extend] Index of /trunk/Core/OpenFOAM-1.4.1-dev/src/finiteVolume/fields/fvPatchFields/derived/fixedMeanValue
when i included these files to the standard .C and .H which are available in my computer(standered .C and .H files) and tried to execute it it is showing the following error:
Making dependency list for source file cavitatingFoam.C
SOURCE=cavitatingFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/appl/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude -I/appl/OpenFOAM/OpenFOAM-1.6.x/src/transportModels -I/appl/OpenFOAM/OpenFOAM-1.6.x/src/transportModels/incompressible/lnInclude -I/appl/OpenFOAM/OpenFOAM-1.6.x/src/transportModels/interfaceProperties/lnInclude -I/appl/OpenFOAM/OpenFOAM-1.6.x/src/turbulenceModels/incompressible/turbulenceModel -I/appl/OpenFOAM/OpenFOAM-1.6.x/src/thermophysicalModels/barotropicCompressibilityModel/lnInclude -IlnInclude -I. -I/appl/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude -I/appl/OpenFOAM/OpenFOAM-1.6.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc43DPOpt/cavitatingFoam.o
In file included from cavitatingFoam.C:46:
fixedMeanValueFvPatchField.H: In function ‘int main(int, char**)’:
fixedMeanValueFvPatchField.H:42: error: ‘namespace’ definition is not allowed here
In file included from fixedMeanValueFvPatchField.H:176,
from cavitatingFoam.C:46:
fixedMeanValueFvPatchField.C:32: error: ‘namespace’ definition is not allowed here
/appl/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’
/appl/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/readPISOControls.H:3: warning: unused variable ‘nCorr’
/appl/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInc
So could you please help me in this regard
i would be greatful to you
Thanks in advance
Regards,
Siddu
Find the nearest forum / newsgroup to the source.
Maybe here
http://extend-project.de/
Several things to bear in mind
1. They've probably seen it already
2. They probably know how to fix it in the best way (if they haven't done so already)
3. They have the most motivation to get it fixed quickly
Here, you're just taking a blind shot in the dark that someone might just know something.
How To Ask Questions The Smart Way
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Post the code for cavitatingFoam.C; if it is like the code here
OpenFOAM programmer's C++ documentation
Then I say the cavitatingFoam.C code is VERY poorly written.
They are using #include from inside the main function; this is really really bad stuff.
Tim S.
Last edited by stahta01; 11-12-2010 at 06:12 PM.