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

Linking error : undefined reference to - OpenFOAM 6

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2019, 02:04
Unhappy Linking error : undefined reference to - OpenFOAM 6
  #1
New Member
 
John
Join Date: Mar 2019
Posts: 24
Rep Power: 2
thintn222 is on a distinguished road
Hi foamer, recently i developed a solver for condensation in OpenFoam v6. when i compiled the solver by (wmake libso or wmake) it had that linking error and i really dont know what i missing in the Make folder. Below is the complete details:

Main source code contains:
Allwclean ,Allwmake, createFields.H, pEqn.H, TEqn.H, Make, main.C, temperaturePhaseChangeTwoPhaseMixtures (sub-folder with another Make folder in it)

error log:

Code:
/home/foam6/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib/libphaseTemperatureChangeTwoPhaseMixtures.so: undefined reference to `Foam::twoPhaseMixtureEThermo::thermoName() const'
/home/foam6/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib/libphaseTemperatureChangeTwoPhaseMixtures.so: undefined reference to `Foam::twoPhaseMixtureEThermo::alphahe(int) const'
/home/foam6/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib/libphaseTemperatureChangeTwoPhaseMixtures.so: undefined reference to `Foam::twoPhaseMixtureEThermo::W() const'
/home/foam6/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/lib/libphaseTemperatureChangeTwoPhaseMixtures.so: undefined reference to `Foam::twoPhaseMixtureEThermo::alphahe() const'
collect2: error: ld returned 1 exit status
Make/options folder

Code:
interPhaseChangePath = $(FOAM_SOLVERS)/multiphase/interPhaseChangeFoam

EXE_INC = \
    -I. \
    -ItemperaturePhaseChangeTwoPhaseMixtures/lnInclude \
    -I$(interPhaseChangePath) \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/fvOptions/lnInclude\
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
    -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lfvOptions \
    -lmeshTools \
    -lsampling \
    -lphaseTemperatureChangeTwoPhaseMixtures \
    -ltwoPhaseMixture \
    -linterfaceProperties \
    -ltwoPhaseProperties \
    -lincompressibleTransportModels \
    -lturbulenceModels \
    -lincompressibleTurbulenceModels \
    -lfluidThermophysicalModels
I really confused, when i go to the sub folder temperaturePhaseChangeTwoPhaseMixtures and do wmake libso , it successfully. But after that go back to the main code (cd ..) and do wmake libso , it had that error !.

Sorry for my poor English, i really exhausted.

Any suggestion are really appreciated. Thank you so much for reading
thintn222 is offline   Reply With Quote

Old   August 14, 2019, 08:34
Default
  #2
New Member
 
John
Join Date: Mar 2019
Posts: 24
Rep Power: 2
thintn222 is on a distinguished road
fixed it myself, i forgot to return value of those variables in .C file. if anyone meet the same error just put something like that in your source code.

Code:
Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::W()const
{
   NotImplemented;
   return tmp<Foam::volScalarField>();
}
Good luck.
thintn222 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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.com] Compiling v1806 from source Sgs OpenFOAM Installation 10 January 20, 2019 20:46
OpenFOAM course for beginners Jibran OpenFOAM Announcements from Other Sources 0 September 12, 2018 11:32
OpenFoam-1.7.x on Suse 11.2 (64bit) does not compile val46 OpenFOAM Installation 4 August 27, 2010 03:43
Compiling new Solver with wmake lin123 OpenFOAM 3 April 13, 2010 14:18
OpenFOAM with Cygwin kitchener OpenFOAM Installation 6 April 24, 2006 23:09


All times are GMT -4. The time now is 19:13.