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

undefined reference to

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 22, 2022, 03:07
Default undefined reference to
  #1
Member
 
hari charan
Join Date: Sep 2021
Location: India,hyderabad
Posts: 96
Rep Power: 4
saicharan662000@gmail.com is on a distinguished road
Hello guys,
I am trying to implement energy equation and mass transfer model in interPhaseChangeFoam. I implemented mass transfer model, it compiled well.But when I am compiling solver I am getting the following error.



Code:
/home/hari/OpenFOAM/hari-8/applications/solvers/multiphase/interPhaseChangeFoam_2/createFields.H:50: undefined reference to `Foam::phaseChangeTwoPhaseMixture::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&)'
/usr/bin/ld.bfd: /home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/lib/libmyIncompressibleTwoPhaseThermalMixture.so: undefined reference to `Foam::conductivityModel::New(Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&)'
collect2: error: ld returned 1 exit status

My options file is like this.

Code:
EXE_INC = \
    -I. \
    -I$(LIB_SRC)/transportModels/lnInclude \
    -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
    -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude \
    -I$(LIB_SRC)/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/twoPhaseModels/myIncompressibleTwoPhaseThermalMixture/lnInclude \
    -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
    -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/dynamicFvMesh/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -IphaseChangeTwoPhaseMixtures/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/transportModels/conductivityModels/lnInclude \
    -DFULLDEBUG -g -O0

EXE_LIBS = \
    -lphaseChangeTwoPhaseMixtures \
    -ltwoPhaseMixture \
    -linterfaceProperties \
    -ltwoPhaseProperties \
    -lincompressibleTransportModels \
    -lmomentumTransportModels \
    -lincompressibleMomentumTransportModels \
    -lfiniteVolume \
    -ldynamicFvMesh \
    -ltopoChangerFvMesh \
    -lfvOptions \
    -lmeshTools \
    -L/home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/lib \
    -lmyIncompressibleTwoPhaseThermalMixture
Can anyone help me to understand where the problem is.
saicharan662000@gmail.com is offline   Reply With Quote

Old   April 23, 2022, 04:23
Default
  #2
New Member
 
zink
Join Date: Oct 2015
Posts: 29
Rep Power: 10
ansab_sindhu is on a distinguished road
Quote:
Originally Posted by saicharan662000@gmail.com View Post
Hello guys,
I am trying to implement energy equation and mass transfer model in interPhaseChangeFoam. I implemented mass transfer model, it compiled well.But when I am compiling solver I am getting the following error.



Code:
/home/hari/OpenFOAM/hari-8/applications/solvers/multiphase/interPhaseChangeFoam_2/createFields.H:50: undefined reference to `Foam::phaseChangeTwoPhaseMixture::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&)'
/usr/bin/ld.bfd: /home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/lib/libmyIncompressibleTwoPhaseThermalMixture.so: undefined reference to `Foam::conductivityModel::New(Foam::word const&, Foam::dictionary const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&)'
collect2: error: ld returned 1 exit status

My options file is like this.

Code:
EXE_INC = \
    -I. \
    -I$(LIB_SRC)/transportModels/lnInclude \
    -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
    -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude \
    -I$(LIB_SRC)/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/twoPhaseModels/myIncompressibleTwoPhaseThermalMixture/lnInclude \
    -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
    -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/dynamicFvMesh/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -IphaseChangeTwoPhaseMixtures/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/transportModels/conductivityModels/lnInclude \
    -DFULLDEBUG -g -O0

EXE_LIBS = \
    -lphaseChangeTwoPhaseMixtures \
    -ltwoPhaseMixture \
    -linterfaceProperties \
    -ltwoPhaseProperties \
    -lincompressibleTransportModels \
    -lmomentumTransportModels \
    -lincompressibleMomentumTransportModels \
    -lfiniteVolume \
    -ldynamicFvMesh \
    -ltopoChangerFvMesh \
    -lfvOptions \
    -lmeshTools \
    -L/home/hari/OpenFOAM/hari-8/platforms/linux64GccDPInt32Opt/lib \
    -lmyIncompressibleTwoPhaseThermalMixture
Can anyone help me to understand where the problem is.
Are you implementing a model or schemes?

The error means that your compilation does not link with Openfoam SRC.

Can you elaborate a bit so that i can comment further?
ansab_sindhu is offline   Reply With Quote

Old   April 23, 2022, 06:57
Default
  #3
Member
 
hari charan
Join Date: Sep 2021
Location: India,hyderabad
Posts: 96
Rep Power: 4
saicharan662000@gmail.com is on a distinguished road
In SRC user directory I implemented a mixture model called myIncompressibleTwoPhaseThermalMixture. This is in src/twoPhaseModels.
And in SRC/transportModels I have conductivity models and fourier model.
The source code in conductivity model is like selecting fourier model for evaluating thermal conductivity.
I compiled both transportModels and twoPhaseModels with out error. But when I link them to solver I got the error I mentioned above. The compiled files are in platforms/lib folder. I gave correct path like $FOAM_USER_LIBBIN to lib folder(i.e compiled directored which is lib folder in platforms folder)
Thanks in advance
saicharan662000@gmail.com is offline   Reply With Quote

Reply

Tags
interphasechangefoam, openfoam, openfoam8


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
Adding Libraries to OpenFOAM MCrossover97 OpenFOAM Programming & Development 10 February 23, 2024 02:34
can not complie fluentDataToFoam in OF2.1.1 hewei OpenFOAM Pre-Processing 20 September 8, 2018 09:19
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 08:53
compile error about FJMPI chiven OpenFOAM Installation 11 March 31, 2010 06:27
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08


All times are GMT -4. The time now is 16:41.