CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (http://www.cfd-online.com/Forums/openfoam-installation/)
-   -   OF14 compilation error bistreamb is already declared in this scope (http://www.cfd-online.com/Forums/openfoam-installation/57331-of14-compilation-error-bistreamb-already-declared-scope.html)

rafal April 16, 2007 04:22

Hallo all, I have some proble
 
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

hjasak April 16, 2007 05:18

I've seen the same thing on my
 
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

rafal April 16, 2007 05:39

Hi Hrv, Thanks for hint. I
 
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 April 18, 2007 05:53

Hi Hrv, Thanks for the tip. I
 
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 http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

mwibmer August 26, 2008 09:18

Hi, I also have some proble
 
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 August 26, 2008 11:23

sorry, I found a related topic
 
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...


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