|
[Sponsors] |
April 28, 2012, 17:05 |
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 |
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 |
|
April 28, 2012, 17:37 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
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 If it builds successfully, then you can compare how that application works versus the one you're developing! Best regards, Bruno
__________________
|
|
April 28, 2012, 18:13 |
|
#3 |
New Member
Murilo Pereira de Almeida
Join Date: Feb 2012
Location: Fortaleza, Ce, Brazil
Posts: 2
Rep Power: 0 |
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 |
|
Tags |
ifstream.h, openfoam 2.0.x |
|
|
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 08:21 |
Erosion modeling in OpenFOAM 2.1.0 | mecbe2002 | OpenFOAM | 6 | November 9, 2017 22:29 |
Can openfoam solve problems in cylindrical and spherical coordinate systems? | GGerber | OpenFOAM Running, Solving & CFD | 6 | February 5, 2015 11:37 |
[OpenFOAM.org] Installing OpenFOAM 2.1.0 on ROCKS cluster | aerospain | OpenFOAM Installation | 6 | December 15, 2014 04:35 |
Problem? with Installation of OpenFOAM 2.1.0 on to Ubuntu 10.4.4 VirtualBox | Stubby | OpenFOAM Installation | 8 | March 5, 2012 16:12 |