CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > 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 Search this Thread 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
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Salome] Salome -> OpenFoam ( Export as unv) Problems encountered tibo11 OpenFOAM Meshing & Mesh Conversion 13 May 1, 2019 07:21
Erosion modeling in OpenFOAM 2.1.0 mecbe2002 OpenFOAM 6 November 9, 2017 21:29
Can openfoam solve problems in cylindrical and spherical coordinate systems? GGerber OpenFOAM Running, Solving & CFD 6 February 5, 2015 10:37
[OpenFOAM.org] Installing OpenFOAM 2.1.0 on ROCKS cluster aerospain OpenFOAM Installation 6 December 15, 2014 03:35
Problem? with Installation of OpenFOAM 2.1.0 on to Ubuntu 10.4.4 VirtualBox Stubby OpenFOAM Installation 8 March 5, 2012 15:12


All times are GMT -4. The time now is 15:02.