CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

OF14 compilation error bistreamb is already declared in this scope

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 16, 2007, 04:22
Default Hallo all, I have some proble
  #1
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
Hallo all,
I have some problems with compilation of OF1.4.
It seems to be problem in new STL.

Here is the top most error:

+ wmake libso triSurface
SOURCE=triSurface/interfaces/STL/readSTLASCII.L ; flex++ -f $SOURCE ; mv lex.yy.cc Make/linuxGcc4DPDebug/readSTLASCII.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-40 -IlnInclude -I. -I/home/rafal/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -pthread -c Make/linuxGcc4DPDebug/readSTLASCII.C -o Make/linuxGcc4DPDebug/readSTLASCII.o
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/backward/iostream.h:31,
from /usr/local/include/FlexLexer.h:47,
from Make/linuxGcc4DPDebug/readSTLASCII.C:234:
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/backward/backward_warning.h: 32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <x> header for the <x.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4/backward/iostream.h:36: error: 'istream' is already declared in this scope
lex.yy.cc: In member function 'virtual int yyFlexLexer::yylex()':
lex.yy.cc:5816: warning: use of old-style cast
lex.yy.cc:5816: warning: use of old-style cast
lex.yy.cc:5832: warning: use of old-style cast
lex.yy.cc:6003: warning: use of old-style cast
lex.yy.cc:6021: error: cannot convert 'std::istream*' to 'istream*' in assignment
lex.yy.cc: In member function 'int yyFlexLexer::yy_get_next_buffer()':
lex.yy.cc:6252: warning: use of old-style cast
lex.yy.cc:6279: warning: use of old-style cast
lex.yy.cc:6292: warning: use of old-style cast
lex.yy.cc:6293: warning: use of old-style cast
lex.yy.cc:6314: warning: use of old-style cast
lex.yy.cc: In member function 'yy_state_type yyFlexLexer::yy_get_previous_state()':
lex.yy.cc:6362: warning: use of old-style cast
lex.yy.cc:6362: warning: use of old-style cast
lex.yy.cc: In member function 'void yyFlexLexer::yyunput(int, char*)':
lex.yy.cc:6423: warning: use of old-style cast
lex.yy.cc:6424: warning: use of old-style cast
lex.yy.cc:6432: warning: use of old-style cast
lex.yy.cc: In member function 'int yyFlexLexer::yyinput()':
lex.yy.cc:6501: warning: use of old-style cast
lex.yy.cc: In member function 'void yyFlexLexer::yy_load_buffer_state()':
lex.yy.cc:6549: error: cannot convert 'istream*' to 'std::istream*' in assignment
lex.yy.cc: In member function 'virtual yy_buffer_state* yyFlexLexer::yy_create_buffer(std::istream*, int)':
lex.yy.cc:6558: warning: use of old-style cast
lex.yy.cc:6567: warning: use of old-style cast
lex.yy.cc: In member function 'virtual void yyFlexLexer::yy_delete_buffer(yy_buffer_state*)':
lex.yy.cc:6585: warning: use of old-style cast
lex.yy.cc:6588: warning: use of old-style cast
lex.yy.cc:6590: warning: use of old-style cast
lex.yy.cc: In member function 'void yyFlexLexer::yy_init_buffer(yy_buffer_state*, std::istream*)':
lex.yy.cc:6600: error: cannot convert 'std::istream*' to 'istream*' in assignment
lex.yy.cc: In member function 'void yyFlexLexer::yy_push_state(int)':
lex.yy.cc:6654: warning: use of old-style cast
lex.yy.cc:6658: warning: use of old-style cast
lex.yy.cc:6658: warning: use of old-style cast
lex.yy.cc: In function 'void* yy_flex_alloc(yy_size_t)':
lex.yy.cc:6760: warning: use of old-style cast
lex.yy.cc: In function 'void* yy_flex_realloc(void*, yy_size_t)':
lex.yy.cc:6778: warning: use of old-style cast
lex.yy.cc:6778: warning: use of old-style cast
lex.yy.cc: At global scope:
lex.yy.cc:5637: warning: 'yy_start_stack_ptr' defined but not used
lex.yy.cc:5638: warning: 'yy_start_stack_depth' defined but not used
lex.yy.cc:5639: warning: 'yy_start_stack' defined but not used
lex.yy.cc:5641: warning: 'void yy_push_state(int)' declared 'static' but never defined
lex.yy.cc:5644: warning: 'void yy_pop_state()' declared 'static' but never defined
lex.yy.cc:5647: warning: 'int yy_top_state()' declared 'static' but never defined
make: *** [Make/linuxGcc4DPDebug/readSTLASCII.o] Error 1

Additional info:
- I used patch for OpenFOAM-1.4/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L
http://www.cfd-online.com/cgi-bin/Op...w.cgi?126/4189
- OF-1.3 compiles smoothly
- I use gcc411 not 412 (but assume it doent matter)
- Gentoo box (possibly all debian branch also affected with this error)

It seems to be another namespace conflict,
but i dont know how to correct it

Please help. Any hint appreciated.
rafal
rafal is offline   Reply With Quote

Old   April 16, 2007, 05:18
Default I've seen the same thing on my
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
I've seen the same thing on my SuSe-10.1 and ended up re-introducing foamFlex++ we had in previous versions. This was patched up to sort out similar problem with the standard flex (which does not seem to be developed any more) and it fixed my stuff.

Not sure if this will remain - still investigating in the light of Martin's RedHat suggestions.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   April 16, 2007, 05:39
Default Hi Hrv, Thanks for hint. I
  #3
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
Hi Hrv,

Thanks for hint. I will try to still foamFlex
from OF1.3 and come back in case of problems.

thanks
rafal

(BTW I didnt see anywhere information
removing foamFlex, but it is missing from utils)
rafal is offline   Reply With Quote

Old   April 18, 2007, 05:53
Default Hi Hrv, Thanks for the tip. I
  #4
Member
 
rafal zietara
Join Date: Mar 2009
Location: Manchester, UK
Posts: 60
Rep Power: 17
rafal is on a distinguished road
Hi Hrv,
Thanks for the tip. It works. It compiles.

Here is rough howto in case someone has the
same problem like me:

* copy
~/OpenFOAM/OpenFOAM-1.3/applications/utilities/miscellaneous/foamFlex
to
~/OpenFOAM/OpenFOAM-1.4/applications/utilities/miscellaneous

* add the following lines in ~/OpenFOAM/OpenFOAM-1.3/src/Allmake:

cd $FOAM_APP/utilities/miscellaneous
wmake exe foamFlex
cp foamFlex/FlexLexer.h $FOAM_SRC/OpenFOAM/lnInclude
cd $FOAM_SRC


before the line
(cd Pstream ; ./Allwmake)

* make wmake to use foamFlex++ instead of flex++:
in ~/OpenFOAM/OpenFOAM-1.4/wmake/rules/General
the following files: flex++ and flex++.test
change: flex++
to: foamFles++

Hope that helps to someone.


Now i still do not run OF14 i hit some runtime
error which I am still trying to solve.

rafal

PS. Now i appreciate extensive path settings in OF
I can compile one version and work on the other
Once again I have to say about OF -
Great Piece of Code
rafal is offline   Reply With Quote

Old   August 26, 2008, 09:18
Default Hi, I also have some proble
  #5
New Member
 
Michael Wibmer
Join Date: Mar 2009
Posts: 4
Rep Power: 17
mwibmer is on a distinguished road
Hi,

I also have some problems compiling 1.4.1-dev on Redhat. (64 Bits).

I get the following error message:

+ wmake libso triSurface
triSurface/interfaces/STL/readSTLASCII.L:56: error: previous declaration of `int yywrap()' with C++ linkage
lex.yy.cc:5288: error: conflicts with new declaration with C linkage
lex.yy.cc: In member function `int STLLexer::lex()':
lex.yy.cc:5488: warning: use of old-style cast
lex.yy.cc:5488: warning: use of old-style cast
lex.yy.cc:5504: warning: use of old-style cast
lex.yy.cc:5718: warning: use of old-style cast
triSurface/interfaces/STL/readSTLASCII.L:205: warning: unused variable 'endPtr'
lex.yy.cc: In member function `int yyFlexLexer::yy_get_next_buffer()':
lex.yy.cc:5967: warning: use of old-style cast
lex.yy.cc:5994: warning: use of old-style cast
lex.yy.cc:6007: warning: use of old-style cast
lex.yy.cc:6008: warning: use of old-style cast
lex.yy.cc:6029: warning: use of old-style cast
lex.yy.cc: In member function `yy_state_type yyFlexLexer::yy_get_previous_state()':
lex.yy.cc:6077: warning: use of old-style cast
lex.yy.cc:6077: warning: use of old-style cast
lex.yy.cc: In member function `void yyFlexLexer::yyunput(int, char*)':
lex.yy.cc:6138: warning: use of old-style cast
lex.yy.cc:6139: warning: use of old-style cast
lex.yy.cc:6147: warning: use of old-style cast
lex.yy.cc: In member function `int yyFlexLexer::yyinput()':
lex.yy.cc:6216: warning: use of old-style cast
lex.yy.cc: In member function `virtual yy_buffer_state* yyFlexLexer::yy_create_buffer(std::istream*, int)':
lex.yy.cc:6272: warning: use of old-style cast
lex.yy.cc:6281: warning: use of old-style cast
lex.yy.cc: In member function `virtual void yyFlexLexer::yy_delete_buffer(yy_buffer_state*)':
lex.yy.cc:6299: warning: use of old-style cast
lex.yy.cc:6302: warning: use of old-style cast
lex.yy.cc:6304: warning: use of old-style cast
lex.yy.cc: In member function `void yyFlexLexer::yy_push_state(int)':
lex.yy.cc:6367: warning: use of old-style cast
lex.yy.cc:6371: warning: use of old-style cast
lex.yy.cc:6371: warning: use of old-style cast
lex.yy.cc: In function `void* yy_flex_alloc(yy_size_t)':
lex.yy.cc:6473: warning: use of old-style cast
lex.yy.cc: In function `void* yy_flex_realloc(void*, yy_size_t)':
lex.yy.cc:6491: warning: use of old-style cast
lex.yy.cc:6491: warning: use of old-style cast
lex.yy.cc: At global scope:
lex.yy.cc:5307: warning: 'yy_start_stack_ptr' defined but not used
lex.yy.cc:5308: warning: 'yy_start_stack_depth' defined but not used
lex.yy.cc:5309: warning: 'yy_start_stack' defined but not used
lex.yy.cc:5311: warning: 'void yy_push_state(int)' declared `static' but never defined
lex.yy.cc:5314: warning: 'void yy_pop_state()' declared `static' but never defined
lex.yy.cc:5317: warning: 'int yy_top_state()' declared `static' but never defined

I uncommented the yywrap function in the corresponding .L file, but this gives troubles in the compiling proccess later on (as to be expected).

Did anybody have the same troubles? The flex++ version is 2.5.4
mwibmer is offline   Reply With Quote

Old   August 26, 2008, 11:23
Default sorry, I found a related topic
  #6
New Member
 
Michael Wibmer
Join Date: Mar 2009
Posts: 4
Rep Power: 17
mwibmer is on a distinguished road
sorry, I found a related topic at

http://www.cfd-online.com/OpenFOAM_D...tml?1217020603

I replaced
"int yywrap()"
with
"extern "C" int yywrap()"

the compilation is continuing...
mwibmer is offline   Reply With Quote

Reply


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
Error while running lesInterFOAM OF 15 on the initial amp BC files of OF14 kumar OpenFOAM Running, Solving & CFD 0 December 18, 2008 06:26
cbrtf not declared lakeat OpenFOAM Installation 0 April 3, 2008 11:25
Compilation error ovchin OpenFOAM Bugs 4 September 20, 2007 03:56
Compilation error skabilan OpenFOAM Installation 1 September 17, 2007 13:33
OF14 compilation error with icc91 ueno OpenFOAM Installation 0 June 1, 2007 08:54


All times are GMT -4. The time now is 07:54.