|
[Sponsors] |
regarding error undefined reference to ... in openfoam. |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 1, 2021, 04:41 |
regarding error undefined reference to ... in openfoam.
|
#1 |
Member
hari charan
Join Date: Sep 2021
Location: India,hyderabad
Posts: 97
Rep Power: 5 |
hello guys,
I am trying to develop my own solver using compressibleInterFoam. I modified the solver and compiled it. I got the following error. undefined reference to `Foam::twoPhaseMixtureThermo::twoPhaseMixtureTherm o(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::word const&)' /usr/bin/ld.bfd: myCompressibleInterFoam.C.text.startup+0x2fcf): undefined reference to `Foam::twoPhaseMixtureThermo::twoPhaseMixtureTherm o(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::word const&)' collect2: error: ld returned 1 exit status Can anyone help me with this? Thanks in advance |
|
December 1, 2021, 13:12 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,763
Rep Power: 66 |
You made a call to something that doesn't exist in the namespace hierarchy (hence the undefined reference). The thingy you tried to call is printed there exactly for you.
No idea what you modified but it could be something as simple as forgetting to link the libraries for the function that you are trying to call. This could easily happen if you just copy some lines from another solver and forget to link them (the .so shared object). |
|
April 12, 2022, 05:13 |
|
#3 |
Member
hari charan
Join Date: Sep 2021
Location: India,hyderabad
Posts: 97
Rep Power: 5 |
Hello lucky,
I declared a variable mDot as a member Function in twoPhaseMixtureThermo.H . Later I used it in twoPhaseMixtureThermo.C and later used it in PEqn.H. I compiled the twoPhaseMixtureThermo library. It has no error. But when I compiled the solver I got the above error. My options folder is like this. EXE_INC = \ -I. \ -ItwoPhaseMixtureThermo/lnInclude \ -IVoFphaseCompressibleMomentumTransportModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -ltwoPhaseMixtureThermo \ -ltwoPhaseSurfaceTension \ -lfluidThermophysicalModels \ -lspecie \ -ltwoPhaseMixture \ -ltwoPhaseProperties \ -linterfaceProperties \ -lmomentumTransportModels \ -lfluidThermoMomentumTransportModels \ -lVoFphaseCompressibleMomentumTransportModels \ -lfiniteVolume \ -lfvOptions \ -lmeshTools \ -ldynamicMesh \ -ldynamicFvMesh twoPhaseMixtureThermo is already in solver so I think there is no Need to link it again. I just modified it to calculate mDot |
|
December 8, 2023, 07:02 |
|
#4 |
New Member
Roshan Shanmughan
Join Date: Jun 2017
Posts: 3
Rep Power: 9 |
Hi Saicharan,
Did you manage to resolve your problem? If yes, could you please share how you did it? |
|
December 11, 2023, 03:02 |
|
#5 | |
New Member
lisa purnellsw
Join Date: Dec 2023
Posts: 1
Rep Power: 0 |
Quote:
|
||
Tags |
openfaom-8, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] Not found many .so files when installing OpenFOAM 6 | lengjun | OpenFOAM Installation | 2 | December 12, 2022 23:08 |
[OpenFOAM.com] An Error in recompiling of openFoam-4.0 | alimea | OpenFOAM Installation | 4 | April 8, 2020 15:44 |
[OpenFOAM.org] OpenFoam 3 on centOS | Karakal | OpenFOAM Installation | 4 | July 27, 2016 10:15 |
New OpenFOAM Forum Structure | jola | OpenFOAM | 2 | October 19, 2011 07:55 |
Compiling new Solver with wmake | lin123 | OpenFOAM | 3 | April 13, 2010 15:18 |