CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   interFoam symbol lookup error (http://www.cfd-online.com/Forums/openfoam-programming-development/119742-interfoam-symbol-lookup-error.html)

sharonyue June 24, 2013 05:24

interFoam symbol lookup error
 
Hi,

I am a newbie to linux.so its a mass when I compile my solver.

I changed the code in "twoPhaseMixture", and rename it "myTwoPhaseMixture" and this is the code in make/file:
Code:


myTwoPhaseMixture.C

LIB = $(FOAM_USER_LIBBIN)/libincompressibleTransportModels

Then I wamke libso, succeed.

In interFoam, I revise it like this, and name it as myinterFoam, except this nothing changed:
Code:

#include "/home/cfd/myCase/mylib/twoPhaseMixture/myTwoPhaseMixture.H"
and wmake successful.

But when I run myinterFoam, it said:
Code:

myinterFoam: symbol lookup error: /home/cfd/OpenFOAM/cfd-2.2.0/platforms/linux64GccDPOpt/lib/libincompressibleTransportModels.so: undefined symbol: _ZTIN4Foam14transportModelE
Anyone knows how to handle this?
Thanks

nimasam June 24, 2013 06:55

Dear foresst
in Make folder, in Options files, you should add
Quote:

-L$(FOAM_USER_LIBBIN) \
-lincompressibleTransportModel

sharonyue June 24, 2013 08:21

1 Attachment(s)
Quote:

Originally Posted by nimasam (Post 435584)
Dear foresst
in Make folder, in Options files, you should add

Hi Nima,

It works, but there are some other problems: In order to find out whether its incurred by my code, I make a test:

(1) copy twoPhaseMixture.C and twoPhaseMixture.H to my folder
(2) wmake libso
(3) copy interFoam too my folder
(4) wmake.

But it said "undefined reference", This time I didnot touch any code, so I dont know whats wrong with this. I attach my code, If you have time, could you please help me to check it out? I believe its easy for you. Thanks.

nimasam June 24, 2013 08:41

i can not unextract your zip file

sharonyue June 25, 2013 21:24

I think I compile the lib successfully, but problem arises in compiling the solver.
this is my option:
Code:

EXE_INC = \
    -I$(LIB_SRC)/transportModels \
    -I $home/cfd/myCase/mylib/incompressibleTwoPhaseMixture/incompressible/lnInclude \
    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/fvOptions/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude

EXE_LIBS = \
    -linterfaceProperties \
    -ltwoPhaseInterfaceProperties \
    -lincompressibleTurbulenceModel \
    -lincompressibleRASModels \
    -lincompressibleLESModels \
    -lfiniteVolume \
    -lmeshTools \
    -lfvOptions \
    -lsampling \
    -L$(FOAM_USER_LIBBIN) \
    -lincompressibleTransportModels

when I wmake, it said:
Code:

cfd@cfd:~/myCase/solvers/interFoam$ wmake
options:22:27: warning: backslash and newline separated by space [enabled by default]
SOURCE=interFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I. -I/opt/openfoam220/src/transportModels -I ome/cfd/myCase/mylib/incompressibleTwoPhaseMixture/incompressible/lnInclude -I/opt/openfoam220/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam220/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam220/src/finiteVolume/lnInclude -I/opt/openfoam220/src/meshTools/lnInclude -I/opt/openfoam220/src/fvOptions/lnInclude -I/opt/openfoam220/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/interFoam.o
interFoam.C:44:29: fatal error: twoPhaseMixture.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/interFoam.o] Error 1

But this file is in that folder.

nimasam June 26, 2013 01:01

Quote:

twoPhaseMixture.H: No such file or directory compilation terminated.
did you include it properly in right path?

mecman July 11, 2013 03:27

fatal error
 
Hi Forrest
i have problem same youre problem....do You solve this problem?if you solve,can you help me?
my error:
interFoamDiabatic.C:44:29: fatal error: twoPhaseMixture.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/interFoamDiabatic.o] Error 1


nimasam July 11, 2013 06:34

Dear mohamad
when you use an include file! you should tell the compiler where to find it ;)

sharonyue September 17, 2013 05:31

Quote:

Originally Posted by nimasam (Post 439146)
Dear mohamad
when you use an include file! you should tell the compiler where to find it ;)

Sorry, I still cant wmake it.

I "wmake libso" my twophasemixture.c , then in interFoam, I change it into this:
Code:

EXE_INC = \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/fvOptions/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude

EXE_LIBS = \
    -linterfaceProperties \
    -ltwoPhaseInterfaceProperties \
    -lincompressibleTurbulenceModel \
    -lincompressibleRASModels \
    -lincompressibleLESModels \
    -lfiniteVolume \
    -lmeshTools \
    -lfvOptions \
    -lsampling  \
    -L$(FOAM_USER_LIBBIN) \
    -lmyincompressibleTransportModel

but it said: cannot find -lmyincompressibleTransportModel

but I have a myincompressibleTransportModels.so in my FOAM_USER_LIBBIN folder.


Sorry, my fault, it should be -lmyincompressibleTransportModels


All times are GMT -4. The time now is 17:49.