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

[OpenFOAM.com] Undefined reference to %60yyFlexLexeryywrapb

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

Like Tree1Likes
  • 1 Post By elisabet

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2008, 11:34
Default Undefined reference to %60yyFlexLexeryywrapb
  #1
New Member
 
Arjaan Buijk
Join Date: Mar 2009
Posts: 2
Rep Power: 0
arjaan is on a distinguished road
I successfully worked through most of the installation of OpenFOAM-1.4.1 on Ubuntu 8.04 (see details at bottom), except one last issue that occurs twice, and I do not know how to fix:

undefined reference to `yyFlexLexer::yywrap()'

It happens here:
make[2]: Entering directory `/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/solvers/multiphase/lesInterFo am'
g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -Iaveraging -I../interFoam -I/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/src/transportModels -I/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/src/transportModels/incompressible/lnIncl ude -I/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/src/transportModels/interfaceProperties/l nInclude -I/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/src/LESmodels -I/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/src/LESmodels/LESdeltas/lnInclude -I/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread Make/linuxGccDPOpt/lesInterFoam.o -L/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt \
-linterfaceProperties -lincompressibleTransportModels -lincompressibleLESmodels -lfiniteVolume -lOpenFOAM -ldl -lm -o /home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/lesInterFoam
/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libtriSurface.so: undefined reference to `yyFlexLexer::yywrap()'
collect2: ld returned 1 exit status
make[2]: *** [/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/lesInterFoa m] Error 1
make[2]: Leaving directory `/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/solvers/multiphase/lesInterFo am'
make[1]: *** [lesInterFoam] Error 2
make[1]: Leaving directory `/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/solvers/multiphase'
make: *** [multiphase] Error 2

And it happens here:
make[3]: Entering directory `/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/postProcessing/patc h/patchIntegrate'
g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread Make/linuxGccDPOpt/patchIntegrate.o -L/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt \
-lfiniteVolume -lOpenFOAM -ldl -lm -o /home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/patchIntegra te
/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libtriSurface.so: undefined reference to `yyFlexLexer::yywrap()'
collect2: ld returned 1 exit status
make[3]: *** [/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/patchIntegr ate] Error 1
make[3]: Leaving directory `/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/postProcessing/patc h/patchIntegrate'
make[2]: *** [patchIntegrate] Error 2
make[2]: Leaving directory `/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/postProcessing/patc h'
make[1]: *** [patch] Error 2
make[1]: Leaving directory `/home/arjaan/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/postProcessing'
make: *** [postProcessing] Error 2

----
Details of what I did:
(-) Installed Ubuntu 8.04
(-) Downloaded OpenFOAM-1.4.1
Iterated through the installation, as follows:
(-) ssh was not running
See: https://help.ubuntu.com/community/SSHHowto

(-) During Allwmake:

g++ was not found
-----------------
Typed '% g++', which told me to do this:
% sudo apt-get install g++

g77 was not found
-----------------
Typed '% g77', which told me to do this:
% sudo apt-get install g77

flex++ was not found
--------------------
Typed '% flex++', which told me to do this:
% sudo apt-get install flex

gmake was not found
-------------------
% su
% ln -s /usr/bin/make /usr/bin/gmake (as root)
zlib.h was not found
--------------------
See: http://www.cfd-online.com/cgi-bin/Op...cus/discus.cgi -- searched for zlib.h
http://ubuntuforums.org/showthread.php?t=178493
This is a system file: /usr/include/zlib.h
% sudo apt-get install build-essential (This did not fix it..)
% sudo apt-get install zlib1g-dev libssl-dev

X11/Xlib.h - No such file or directory
--------------------------------------
See: https://lists.ubuntu.com/archives/ub...er/099230.html
% sudo apt-get install libx11-dev (post includes instructions how to down-load other packages as well...)

GL/gl.h - No such file or directory
-----------------------------------
See: http://ubuntuforums.org/showthread.php?t=235000
% sudo apt-get install mesa-common-dev (post includes instructions how to --reinstall ...)

/usr/bin/ld: cannot find -lXext
-------------------------------
See: http://packages.ubuntu.com/feisty/x11proto-xext-dev
% sudo apt-get install x11proto-xext-dev (did not fix it...)
% sudo apt-get install libxext-dev
arjaan is offline   Reply With Quote

Old   April 29, 2008, 18:03
Default You should execute all those c
  #2
New Member
 
Bernd F.
Join Date: Mar 2009
Posts: 18
Rep Power: 17
bernd is on a distinguished road
You should execute all those commands like
"sudo apt-get install g++" (then you have to enter the root password of your machine.)

However I can't believe that you really have an error saying "g++ not found" because your make output is proving that g++ is in your PATH.

The "undefined reference to `yyFlexLexer::yywrap()' " may be caused by an older (or completely missing?) flex++. According to other forum posts you need version 2.5.35.

Bernd
bernd is offline   Reply With Quote

Old   April 29, 2008, 19:12
Default Bernd, thanks for the feedbac
  #3
New Member
 
Arjaan Buijk
Join Date: Mar 2009
Posts: 2
Rep Power: 0
arjaan is on a distinguished road
Bernd,
thanks for the feedback.

Sorry for the apparently confusing description.

I actually did execute all those commands, and there are no issues anymore with g++, g77, etc.

The only issue remaining is this undefined reference to yyFlexLexer::yywrap().

I double checked, and I have version 2.5.34 installed.

I'll try to upgrade to 2.5.35. I can not find this version in an existing package for Ubuntu, so I might have to build it first.

You mentioned other forum posts that discuss flex++, can you point me to them ?

Thanks much,
-Arjaan
arjaan is offline   Reply With Quote

Old   April 29, 2008, 19:36
Default >I'll try to upgrade to 2.5.35
  #4
New Member
 
Bernd F.
Join Date: Mar 2009
Posts: 18
Rep Power: 17
bernd is on a distinguished road
>I'll try to upgrade to 2.5.35. I can not find this version in an existing package for Ubuntu, so I might have to build it first.

Correct. I don't say it solves your problem, but the thread below says that 2.5.35 works better than 2.5.33.

>You mentioned other forum posts that discuss flex++, can you point me to them ?

http://www.cfd-online.com/OpenFOAM_D.../126/6070.html
bernd is offline   Reply With Quote

Old   May 8, 2008, 12:05
Default Hi Arjaan, Did you fix your
  #5
Member
 
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 17
elisabet is on a distinguished road
Hi Arjaan,

Did you fix your flex++ problem?
I have exactly the same problem and, despite I have tried to compile OF with different flex versions, the problem persists. Any suggestion?

elisabet
elisabet is offline   Reply With Quote

Old   May 8, 2008, 14:25
Default Ok, I get it. I found the a
  #6
Member
 
Elisabet Mas de les Valls
Join Date: Mar 2009
Location: Barcelona, Spain
Posts: 64
Rep Power: 17
elisabet is on a distinguished road
Ok, I get it.

I found the answer here:
http://the-free-meme.blogspot.com/20...rap-it-up.html

So, I just substituted the line:
extern "C" int yywrap()
with
int yyFlexLexer::yywrap()

in 5 files:
1. $WM_PROJECT_DIR/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L
2. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam .L
3. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent MeshToFoam.L
4. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMe shToFoam.L
5. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L

Now, OF-1.4.1 works perfectly on Ubuntu 8.04 under a 64 bit machine.

elisabet
taalf likes this.
elisabet is offline   Reply With Quote

Old   May 8, 2008, 17:28
Default Since flex is supplied, I do n
  #7
Senior Member
 
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 17
johndeas is on a distinguished road
Since flex is supplied, I do not understand why it is necessary to install it. I had the same problem, having to install flex, zlib-devel and some others to compile the 1.4.1-dev
johndeas is offline   Reply With Quote

Old   May 17, 2008, 15:17
Default Hi. Since I'm compiling OF on
  #8
New Member
 
peter anderson
Join Date: Mar 2009
Posts: 2
Rep Power: 0
andpet is on a distinguished road
Hi.
Since I'm compiling OF on Ubuntu 8.04 I will ask about my problem here.
So far I've followed the advice given above, but now I get :


Make/linuxGccDPOpt/multiphaseMixture.o:multiphaseMixture.C: (.text+0x8210): first defined here
Make/linuxGccDPOpt/multiphaseMixture.o: In function `Foam::multiphaseMixture::solveAlphas(int, bool, double)':
multiphaseMixture.C : (.text+0x82e0): multiple definition of `Foam::multiphaseMixture::solveAlphas(int, bool, double)'
Make/linuxGccDPOpt/multiphaseMixture.o:multiphaseMixture.C: (.text+0x82e0): first defined here
Make/linuxGccDPOpt/multiphaseMixture.o: In function `Foam::multiphaseMixture::correct()':
multiphaseMixture.C: (.text+0x9dc0): multiple definition of `Foam::multiphaseMixture::correct()'
Make/linuxGccDPOpt/multiphaseMixture.o:multiphaseMixture.C: (.text+0x9dc0): first defined here
Make/linuxGccDPOpt/multiphaseMixture.o: In function `Foam::multiphaseMixture::surfaceTensionForce() const':
multiphaseMixture.C: (.text+0xa930): multiple definition of `Foam::multiphaseMixture::surfaceTensionForce() const'
Make/linuxGccDPOpt/multiphaseMixture.o:multiphaseMixture.C: (.text+0xa930): first defined here
Make/linuxGccDPOpt/multiphaseMixture.o: (.rodata+0x0): multiple definition of `Foam::multiphaseMixture::convertToRad'
Make/linuxGccDPOpt/multiphaseMixture.o: (.rodata+0x0): first defined here
Make/linuxGccDPOpt/multiphaseInterFoam.o: In function `main':
multiphaseInterFoam.C: (.text+0xf0): multiple definition of `main'
Make/linuxGccDPOpt/multiphaseInterFoam.o:multiphaseInterFoam.C: (.text+0xf0): first defined here
collect2: ld returned 1 exit status
make[2]: *** [/home/peter/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/multiphaseIn terFoam] Error 1
make[2]: Leaving directory `/home/peter/OpenFOAM/OpenFOAM-1.4.1/applications/solvers/multiphase/multiphaseI nterFoam'
make[1]: *** [multiphaseInterFoam] Error 2
make[1]: Leaving directory `/home/peter/OpenFOAM/OpenFOAM-1.4.1/applications/solvers/multiphase'
make: *** [multiphase] Error 2

Does anyone have some idea about this ?

Thanks Peter
andpet is offline   Reply With Quote

Old   July 21, 2008, 09:58
Default Peter, I tried OF-1.5 on Ub
  #9
New Member
 
Paul Chang
Join Date: Mar 2009
Posts: 11
Rep Power: 17
paulchang is on a distinguished road
Peter,

I tried OF-1.5 on Ubuntu 8.04. The binaries provided by OF official site can be easily installed. I haven't made any test run yet.
(You may need to install Qt4, which provides libQtSql.so to run ParaView)
paulchang is offline   Reply With Quote

Old   August 20, 2008, 13:25
Default Sarah, I have the same proble
  #10
New Member
 
MR Amiralaei
Join Date: Mar 2009
Posts: 20
Rep Power: 17
reza is on a distinguished road
Sarah,
I have the same problem and I cannot find any solution. Please post if you find any.
reza is offline   Reply With Quote

Old   August 22, 2008, 12:58
Default I recently had the same proble
  #11
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
I recently had the same problem and managed to find a solution. OpenFOAM comes with flex++ however it names this utility foamFlex++ which is not used during a compile to my knowledge . Rename the executable to be flex++ and compile it. Do a 'which flex++' and ensure your path is set correctly. Now you can substitute - extern "C" int yywrap() for int yywrap() - in the appropriate files. After doing this the OpenFOAM compile should work!
kev4573 is offline   Reply With Quote

Old   October 29, 2008, 07:00
Default It doesn't work for me. When I
  #12
Member
 
Tomislav Sencic
Join Date: Mar 2009
Posts: 42
Rep Power: 17
tsencic is on a distinguished road
It doesn't work for me. When I try to compile OF-1.4.1-dev I get the error:
/home/tom/OpenFOAM/OpenFOAM-1.4.1-dev/lib/linuxGccDPOpt/libtriSurface.so: undefined reference to `yyFlexLexer::yywrap()'
I use Ubuntu 8.0. I installed flex-2.5.35, renamed foamFlex++ in flex++ (I have both). I did not find the lines extern "C" int yywrap(), I suppose it was corrected.
Any help is welcome.
Tomislav
tsencic is offline   Reply With Quote

Old   October 29, 2008, 12:25
Default You need to replace int yywrap
  #13
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
You need to replace int yywrap() with extern "C" int yywrap() , not the other way around.
kev4573 is offline   Reply With Quote

Old   June 1, 2016, 13:33
Default elisabet's instructions worked for me
  #14
New Member
 
Pavel
Join Date: Aug 2014
Posts: 15
Rep Power: 11
powpawell is on a distinguished road
Quote:
Originally Posted by elisabet View Post
Ok, I get it.

I found the answer here:
http://the-free-meme.blogspot.com/20...rap-it-up.html

So, I just substituted the line:
extern "C" int yywrap()
with
int yyFlexLexer::yywrap()

in 5 files:
1. $WM_PROJECT_DIR/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L
2. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam .L
3. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent MeshToFoam.L
4. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMe shToFoam.L
5. $WM_PROJECT_DIR/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L

Now, OF-1.4.1 works perfectly on Ubuntu 8.04 under a 64 bit machine.

elisabet

----
Thanks for these instructions, elisabet. This worked for me!
powpawell is offline   Reply With Quote

Reply

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
Second Derivative Zero - Boundary Condition fu-ki-pa OpenFOAM 11 March 27, 2021 05:28
LEMOS InflowGenerator r_gordon OpenFOAM Running, Solving & CFD 103 December 18, 2018 01:58
OpenFOAM 1.6-ext git installation on Ubuntu 11.10 x64 Attesz OpenFOAM Installation 45 January 13, 2012 13:38
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
G95 + CGNS Bruno Main CFD Forum 1 January 30, 2007 01:34


All times are GMT -4. The time now is 23:30.