CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Unable to load lib file: "undefined symbol" (http://www.cfd-online.com/Forums/openfoam/74143-unable-load-lib-file-undefined-symbol.html)

gfilip March 25, 2010 10:50

Unable to load lib file: "undefined symbol"
 
Hello everyone,

I am trying to add a new dynamicFvMesh type in 1.6.x. I have compiled the source with wmake libso, with no errors and the .so file is placed inside the $FOAM_USER_LIBBIN directory.

I have added the library into my controlDict, but upon execution of the solver (pimpleDyMFoam), I receive the following warning and error:

Code:

--> FOAM Warning :
    From function dlLibraryTable::open(const fileName& functionLibName)
    in file db/dlLibraryTable/dlLibraryTable.C at line 79
    could not load /home/greg/OpenFOAM/greg-1.6.x/lib/linuxGccDPOpt/libmyVivFvMesh.so: undefined symbol: _ZTVN4Foam22mySinkTrimMotionFvMeshE
Create mesh for time = 0

Selecting dynamicFvMesh mySinkTrimMotionFvMesh


--> FOAM FATAL ERROR:
Unknown dynamicFvMesh type mySinkTrimMotionFvMesh

I have attempted this with both 1.5.x and 1.6.x, and with both, I obtain the same warning and error. Any ideas?


Thanks,


-Greg

wyldckat March 25, 2010 19:14

Greetings Greg,

I don't have experience in building additional libraries for OpenFOAM, but I have dealt with a lot of missing symbols when trying to cross-compile OpenFOAM in Linux to run in Windows.

If you said on which code you based your new dynamicFvMesh, it would be a bit more easier for me to estimate where exactly you haven't defined the class "Foam::mySinkTrimMotionFvMesh", which dlLibraryTable complains about. That should be something like:
Code:

namespace Foam
{
class mySinkTrimMotionFvMesh : public dynamicFvMesh
{

And so forth in the H file (not sure about the public dynamicFvMesh bit), and in the C part:
Code:

Foam::mySinkTrimMotionFvMesh( variables_necessary_here )
{

At the very least, the library should be properly loaded now, but will likely croak somewhere else :( Like I said, with an example library to base myself on, this is what I can estimate.

Best regards,
Bruno

PS: shouldn't you have posted this question on this (OpenFOAM Programming and Development) part of the OpenFOAM forum?

gfilip March 31, 2010 10:51

Hi Bruno,

Thank you for your help. I managed to resolve my issue, and you are right, I should have posted in the programming section of the forum. Sorry about that.


-Greg

dancfd August 29, 2010 11:05

Hi Greg,

How did you resolve your issue? I am receiving a similar error when I run blockMesh and paraFoam:

Code:

--> FOAM Warning :
    From function dlLibraryTable::open(const fileName& functionLibName)
    in file db/dlLibraryTable/dlLibraryTable.C at line 78
    could not load /home/dan/OpenFOAM/dan-1.7.0/lib/linux64GccDPOpt/libfvMotionNewSolvers.so: undefined symbol: _ZTIN4Foam17motionDiffusivityE

Thank you,

Dan

gschaider August 30, 2010 04:40

Quote:

Originally Posted by dancfd (Post 273250)
Hi Greg,

How did you resolve your issue? I am receiving a similar error when I run blockMesh and paraFoam:

Code:

--> FOAM Warning :
    From function dlLibraryTable::open(const fileName& functionLibName)
    in file db/dlLibraryTable/dlLibraryTable.C at line 78
    could not load /home/dan/OpenFOAM/dan-1.7.0/lib/linux64GccDPOpt/libfvMotionNewSolvers.so: undefined symbol: _ZTIN4Foam17motionDiffusivityE

Thank you,

Dan

It's only a warning, so you should be fine (the solver will hopefully provide the missing symbol). If it bothers you go to system/controlDict and comment out the libs-entry for running these utilities

dancfd August 31, 2010 21:52

Thank you, Bernhard!


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