CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Problems IFstream.H in OpenFoam-2.1.0

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 28, 2012, 16:05
Default Problems IFstream.H in OpenFoam-2.1.0
  #1
New Member
 
Murilo Pereira de Almeida
Join Date: Feb 2012
Location: Fortaleza, Ce, Brazil
Posts: 2
Rep Power: 0
murilo is on a distinguished road
I have OpenFoam2.1.0 installed on Mac OS X.
I tried to read and write a text file to get a special parameter
and save some output. Whenever I include either of header files
IFstream.H, OFstream.H, or stream.h on my application I get
compilation errors.

Here is the output message:
------------------Begin of included text ------------------------------

SOURCE=escoamentoFoam.C ; g++-mp-4.5 -m64 -DdarwinIntel64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O2 -DNoRepository -ftemplate-depth-100 -I/Users/murilo/OpenFOAM/OpenFOAM-2.0.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/Users/murilo/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude -I/Users/murilo/OpenFOAM/OpenFOAM-2.0.x/src/OSspecific/POSIX/lnInclude -fPIC -Ddarwin -c $SOURCE -o Make/darwinIntel64Gcc45DPOpt/escoamentoFoam.o
In file included from /opt/local/include/gcc45/c++/fstream:42:0,
from /Users/murilo/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude/OFstream.H:42,
from escoamentoFoam.C:45:
/opt/local/include/gcc45/c++/bits/codecvt.h: In function 'int main(int, char**)':
/opt/local/include/gcc45/c++/bits/codecvt.h:42:1: error: expected '=' before '__attribute__'
/opt/local/include/gcc45/c++/bits/codecvt.h:42:1: error: expected identifier before '__attribute__'
/opt/local/include/gcc45/c++/bits/codecvt.h:42:1: error: expected ';' before '__attribute__'
/opt/local/include/gcc45/c++/bits/codecvt.h:42:1: error: expected primary-expression before '__attribute__'
/opt/local/include/gcc45/c++/bits/codecvt.h:42:1: error: expected ';' before '__attribute__'
escoamentoFoam.C:154:1: error: expected '}' at end of input
make: *** [Make/darwinIntel64Gcc45DPOpt/escoamentoFoam.o] Error 1

-------- End of included lines --------------------------------------------------

I saw some previous posts about similar errors with bits/codecvt.h
but I could not find a solution to my problem.
I believe the problem resides in some environment variables that are not
properly set in my system.

Did anyone had similar problem ? Any clue in how to fix it?

Thanks in advance.

Murilo
murilo is offline   Reply With Quote

Old   April 28, 2012, 16:37
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Murilo and welcome to the forum!

You can check the following test application for ideas (these commands will build it as well):
Code:
foam
cd applications/test/parallel
wmake
The resulting application is named Test-parallel.

If it builds successfully, then you can compare how that application works versus the one you're developing!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   April 28, 2012, 17:13
Default
  #3
New Member
 
Murilo Pereira de Almeida
Join Date: Feb 2012
Location: Fortaleza, Ce, Brazil
Posts: 2
Rep Power: 0
murilo is on a distinguished road
Thanks Bruno,

I just figured out, doing some try and error tests that the problem I had was related to
the place where I put the #include <fstream> line.
The solution: If I insert it outside the main code I get no problem.
Thanks a lot for your reply.

Murilo
murilo is offline   Reply With Quote

Reply

Tags
ifstream.h, openfoam 2.0.x

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can openfoam solve problems in cylindrical and spherical coordinate systems? GGerber OpenFOAM Running, Solving & CFD 6 February 5, 2015 11:37
Installing OpenFOAM 2.1.0 on ROCKS cluster aerospain OpenFOAM Installation 6 December 15, 2014 04:35
Salome -> OpenFoam ( Export as unv) Problems encountered tibo11 OpenFOAM Native Meshers: blockMesh 8 January 9, 2013 07:39
Problem? with Installation of OpenFOAM 2.1.0 on to Ubuntu 10.4.4 VirtualBox Stubby OpenFOAM Installation 8 March 5, 2012 16:12
Erosion modeling in OpenFOAM 2.1.0 mecbe2002 OpenFOAM 5 January 25, 2012 01:10


All times are GMT -4. The time now is 16:21.