CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (

oscar_j July 11, 2007 11:29

hi, I am trying to get the

I am trying to get the compilation of the laplacianFoam solver with wmake. But some errors happens.

I type within $FOAM_APP/solvers/basic/laplacianFoam directory (OpenFOAM-1.4) simply 'wmake' but I have error messages like these:

/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3916: error: variable or field '_M_initialize_moneypunct' declared void
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3916: error: 'int std::moneypunct<wchar_t,>::_M_initialize_moneypunc t' is not a static member of 'class std::moneypunct<wchar_t,>'
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3916: error: '__c_locale' was not declared in this scope
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3917: error: expected primary-expression before 'const'
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3917: error: initializer expression list treated as compound expression
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3921: error: variable or field '_M_initialize_moneypunct' declared void

What's my mistake?


gschaider July 11, 2007 12:26

Hi! This is only a guess: i

This is only a guess: it looks like the compiler uses headers that he is not supposed to (for instance your sytem-g++ tries to use the OpenFOAM-g++-headers (but for some reason the OpenFOAM-g++ is not used))

Take the following steps:
- Check which g++ you are using: 'which g++'
- If it is not the OpenFOAM-g++ check the version with 'g++ -v'
- Try to compile and execute a small helloWorld.C (you'll have to write one yourself) to check whether your compiler is working


PS: is this the first time you're trying to compile any OF-stuff on that machine?

oscar_j July 11, 2007 13:59

Hi Bernhard, I have the fol
Hi Bernhard,

I have the following messages:

1. 'which g++'

-> /home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/g++

2. 'g++ -v'

-> Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr/tmp/gcc-4.1.2 --exec-prefix=/usr/tmp/gcc-4.1.2 --enable-languages=c,c++ --enable-shared --enable-__cxa_atexit --disable-checking
Thread model: posix
gcc version 4.1.2

3. With the compilation of 'HelloWorld.C' appears (gcc HelloWorld.C):

helloworld.C:1:19: error with stdio.h
helloworld.C:6:2: warning: no newline at end of file
helloworld.C: In function 'int main()':
helloworld.C:4: error: 'printf' was not declared in this scope

You're right, the compiler isn't working.

What can I do to fix this problem?


gschaider July 12, 2007 09:48

Nope. You tried a C-HelloWorld
Nope. You tried a C-HelloWorld. Try a C++-HelloWorld.
(although it looks like he doesn'T find standard-Headers. Check whether there are any under /home/oscar/OpenFOAM/linux/gcc-4.1.2/include (especially look for c++/4.1.2/bits/locale_facets.h)

My guess: Something went wrong while unpacking the downloaded tar (not all the files reached the disk).

oscar_j July 14, 2007 15:53

hi, I reviewed the archives

I reviewed the archives of OpenFOAM installation in linux directory (gcc-4.1.2-, j2sdkl-1.4.2_05 and paraview-2.4.4), and they're all ok.

About my compiler error messages I guess that are produce because the compiler installation in WM_PROJECT_INST_DIR/$WM_ARCH/gcc-3.4.? and enviroment variable in the $WM_PROJECT_DIR/.bashrc aren't correctly configured.

I hope to fix it, I'd appreciate any suggestion .

Thank you very much for your help.

oscar_j July 14, 2007 15:57

hi, I forgot it, this is t

I forgot it, this is the first time trying to compile any OpenFoam solver on my machine.


oscar_j July 18, 2007 21:41

hi, I could fix the errors.

I could fix the errors. Thank you very much.
The information about it in this link:


All times are GMT -4. The time now is 10:19.