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

symbol lookup error

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By mirko
  • 1 Post By tooran

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 14, 2011, 16:04
Default symbol lookup error
  #1
Senior Member
 
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17
mirko is on a distinguished road
Hello,

I am developing a boundary condition based on turbulentTemperatureCoupledBaffle and compiling with
Code:
wmake libso
The code compiles, but when I run it, I immediately get the following error:
Code:
multiRegionRadSimpleSolver: symbol lookup error: /opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libcoupledDerivedFvPatchFields.so: undefined symbol: 
_ZN4Foam9NamedEnumINS_22temperatureCoupledBase11KMethodTypeELi4EE5namesE
But, when I list the symbols in the library, this symbol is present:
Code:
 nm  /opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libcoupledDerivedFvPatchFields.so | grep _ZN4Foam9NamedEnumINS_22temperatureCoupledBase11KMethodTypeELi4EE5namesE
                 U _ZN4Foam9NamedEnumINS_22temperatureCoupledBase11KMethodTypeELi4EE5namesE
Any thoughts on what could be going on here?

Thank you,

Mirko
mirko is offline   Reply With Quote

Old   September 14, 2011, 16:35
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
Whenever I get weird, inconsistent errors like that, I try recompiling OpenFOAM. That's my shot in the dark.
marupio is offline   Reply With Quote

Old   September 14, 2011, 17:09
Default
  #3
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Quote:
Originally Posted by mirko View Post

But, when I list the symbols in the library, this symbol is present:
Code:
 nm  /opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64Gcc45DPOpt/lib/libcoupledDerivedFvPatchFields.so | grep _ZN4Foam9NamedEnumINS_22temperatureCoupledBase11KMethodTypeELi4EE5namesE
                 U _ZN4Foam9NamedEnumINS_22temperatureCoupledBase11KMethodTypeELi4EE5namesE
Your symbol might be present, but it is still undefined in that library.
The capital letter U in front of the symbol stands for Undefined...

'man nm' is your friend here.

Martin
mbeaudoin is offline   Reply With Quote

Old   September 14, 2011, 17:33
Default
  #4
Senior Member
 
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17
mirko is on a distinguished road
I was wondering what the `U' meant :-) I should have pursued it further.

Mirko
mirko is offline   Reply With Quote

Old   September 15, 2011, 13:46
Default
  #5
Senior Member
 
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17
mirko is on a distinguished road
I think I understand what went wrong: I was overriding an OpenFOAM library with my own incomplete library.

I am adding a boundary condition derived from compressible::turbulentTemperatureCoupledBaffle. In Make/files, I specified as the destination $FOAM_USER_LIBBIN/libcompressibleTurbulenceModel.

Presumably, this prevented the $FOAM_LIBBIN/libcompressibleTurbulenceModel from linking.

Mirko
Kummi likes this.
mirko is offline   Reply With Quote

Old   June 24, 2013, 20:00
Default
  #6
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Quote:
Originally Posted by mirko View Post
I think I understand what went wrong: I was overriding an OpenFOAM library with my own incomplete library.

I am adding a boundary condition derived from compressible::turbulentTemperatureCoupledBaffle. In Make/files, I specified as the destination $FOAM_USER_LIBBIN/libcompressibleTurbulenceModel.

Presumably, this prevented the $FOAM_LIBBIN/libcompressibleTurbulenceModel from linking.

Mirko
Dear Mirko,

If it prevented the lib from linking, how to relink it with your own lib?
sharonyue is offline   Reply With Quote

Old   November 28, 2013, 07:37
Default
  #7
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
Hisham is on a distinguished road
Dear all,

I got a similar error like that today and it went away after fixing an error in the code. The error was forgetting to add the class name before the function name for some reimplemented virtual functions:

void className::functionName()

instead of just:

void functionName()


Hisham
Hisham is offline   Reply With Quote

Old   October 28, 2014, 11:18
Default
  #8
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 145
Rep Power: 17
ziemowitzima is on a distinguished road
Dear Mirko,
I now that it was in 2009...
but I have similar problem,
but even more strange...

I developed new BC as well,
but im my case everything run well on one processor, but If I want to run in parallel I got the same error as u had.

running decomposeParDic:

dlopen error : /home/user/OpenFOAM/user-2.3.0/platforms/linux64GccDPOpt/lib/customlibcompressibleTurbulenceModel.so: undefined symbol: _ZN4Foam9NamedEnumINS_22temperatureCoupledBase11KM ethodTypeELi4EE5namesE

any idea ?

thank you
MM
ziemowitzima is offline   Reply With Quote

Old   August 10, 2017, 08:40
Default Any solution?
  #9
Member
 
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9
vcvedant is an unknown quantity at this point
was anyone able to solve this problem?
I am stuck here and can't move forward.
vcvedant is offline   Reply With Quote

Old   October 2, 2017, 17:43
Default
  #10
New Member
 
Jue Wang
Join Date: Apr 2014
Posts: 23
Rep Power: 12
Joe Wang is on a distinguished road
Hi,
I got the same problem. Still looking for information to solve it.
Joe
Joe Wang is offline   Reply With Quote

Old   October 24, 2017, 21:13
Default
  #11
New Member
 
Jue Wang
Join Date: Apr 2014
Posts: 23
Rep Power: 12
Joe Wang is on a distinguished road
Hi,
I'm not sure if it's exactly the same problem as I came across as the following link and I solved mine.
Good luck!
Joe

New dynamic mesh rule with symbol lookup error
Joe Wang is offline   Reply With Quote

Old   March 5, 2020, 15:07
Default
  #12
New Member
 
tooran
Join Date: Nov 2016
Posts: 23
Rep Power: 9
tooran is on a distinguished road
Hi All,


In order to access the mesh information add the follwoing lines in my own library :


const objectRegistry& db();
const volVectorField& U = db().lookupObject<volVectorField>("U");
const fvMesh & mesh = U.mesh();

forAll ( etat, cellI) //loop through cell centres
{

etat[cellI]=mesh.C()[cellI].y();

if ( etat[cellI]< 0.048).....




But because of the
const objectRegistry& db();
const volVectorField& U = db().lookupObject<volVectorField>("U");
const fvMesh & mesh = U.mesh();


when I run it, it shows me error :

symbol lookup error:........................

undefined symbol: _ZN4Foam15viscosityModels2dbEv

Does anybody can help me?




Thanks
tooran is offline   Reply With Quote

Old   March 6, 2020, 20:07
Default
  #13
New Member
 
tooran
Join Date: Nov 2016
Posts: 23
Rep Power: 9
tooran is on a distinguished road
I solved the problem by removing the following lines


const objectRegistry& db();
const volVectorField& U = db().lookupObject<volVectorField>("U");
const fvMesh & mesh = U.mesh();


And just write the following line:
const fvMesh& mesh = U_.mesh();
SHUBHAM9595 likes this.
tooran is offline   Reply With Quote

Old   February 5, 2021, 03:24
Default
  #14
New Member
 
Tushar Survase
Join Date: Nov 2020
Posts: 7
Rep Power: 5
ttsurvase is on a distinguished road
I have faced the similar type of issue. Libraries need to be compiled correctly. Check the file and options of Make folder. In my case, the libraries were not linked. Hope it helps.
ttsurvase is offline   Reply With Quote

Old   August 17, 2021, 09:09
Default
  #15
New Member
 
Elliott Sutton
Join Date: Dec 2019
Posts: 5
Rep Power: 6
Ells96 is on a distinguished road
Quote:
Originally Posted by tooran View Post
I solved the problem by removing the following lines


const objectRegistry& db();
const volVectorField& U = db().lookupObject<volVectorField>("U");
const fvMesh & mesh = U.mesh();


And just write the following line:
const fvMesh& mesh = U_.mesh();
I'm trying to implement a similar thing and had the same code as you first used. I've tried using the same change but get the following error:

Code:
error: ‘const volVectorField& Foam::constitutiveEq::U_’ is private within this context
  147 |    const fvMesh& mesh = U_.mesh();
Did you receive this error? And how do you allow access to U_? Thanks
Ells96 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
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
OpenFOAM install on Ubuntu Natty 11.04 bkubicek OpenFOAM 13 May 26, 2011 05:48
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 18:44
[Netgen] Installation of Netgen in SuSE Linux 92 edvardsenpriv OpenFOAM Meshing & Mesh Conversion 23 January 16, 2009 06:12
user defined function cfduser CFX 0 April 29, 2006 10:58


All times are GMT -4. The time now is 18:21.