|
[Sponsors] |
"undefined reference to" problem with libraries |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 24, 2020, 13:42 |
"undefined reference to" problem with libraries
|
#1 |
New Member
Francesco Latella
Join Date: Apr 2020
Location: Bergamo, Italy
Posts: 15
Rep Power: 6 |
Hi guys,
I'm translating a modified version of Interfoam by the OpenFOAM version 2.2.1 to the latest version OpenFOAM 7. When I try to compile the code I obtain errors about one of the libraries created for this new solver. In particular I obtain an "undefined reference to" here the message Code:
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/home/ag600/OpenFOAM/OpenFOAM-7/src/transportModels/twoPhaseMixture/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/transportModels -I/home/ag600/OpenFOAM/ag600-7/src_myInterFoamVOFSmoothEvap7/interfaceProperties/lnInclude -I/home/ag600/OpenFOAM/ag600-7/src_myInterFoamVOFSmoothEvap7/twoPhaseProperties/lnInclude -I/home/ag600/OpenFOAM/ag600-7/src_myInterFoamVOFSmoothEvap7/twoPhaseMixture/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/transportModels/incompressible/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/transportModels/interfaceProperties/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/TurbulenceModels/incompressible/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/finiteVolume/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/dynamicFvMesh/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/meshTools/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/sampling/lnInclude -IlnInclude -I. -I/home/ag600/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude -I/home/ag600/OpenFOAM/OpenFOAM-7/src/OSspecific/POSIX/lnInclude -fPIC -fuse-ld=bfd -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/myInterFoamVOFSmoothEvap7.o -L/home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib \ -L/home/ag600/OpenFOAM/ag600-7/platforms/linux64GccDPInt32Opt/lib -lmyinterfaceProperties_VOFSmoothEvap -lmytwoPhaseProperties_VOFSmoothEvap -lmytwoPhaseProperties_VOFSmoothEvap -lmytwoPhaseMixture_VOFSmoothEvap -limmiscibleIncompressibleTwoPhaseMixture -lturbulenceModels -lincompressibleTurbulenceModels -lfiniteVolume -ldynamicFvMesh -ltopoChangerFvMesh -lfvOptions -lmeshTools -lOpenFOAM -ldl \ -lm -o /home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/bin/myInterFoamVOFSmoothEvap7 /home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/libmyinterfaceProperties_VOFSmoothEvap.so: undefined reference to `Foam::regIOobject::writeObject(Foam::IOstream::streamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const' /home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/libmyinterfaceProperties_VOFSmoothEvap.so: undefined reference to `Foam::NamedEnum<Foam::UPstream::commsTypes, 3>::names' /home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/libmyinterfaceProperties_VOFSmoothEvap.so: undefined reference to `Foam::IOobject::headerOk()' /home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/libmyinterfaceProperties_VOFSmoothEvap.so: undefined reference to `Foam::Vector<double>::zero' /home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/libmyinterfaceProperties_VOFSmoothEvap.so: undefined reference to `Foam::TimeState::timeIndex() const' /home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/libmyinterfaceProperties_VOFSmoothEvap.so: undefined reference to `Foam::sumReduce(double&, int&, int)' /home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/libmyinterfaceProperties_VOFSmoothEvap.so: undefined reference to `Foam::regIOobject::write() const' /home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/libmyinterfaceProperties_VOFSmoothEvap.so: undefined reference to `Foam::regIOobject::readStream(Foam::word const&)' /home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/lib/libmyinterfaceProperties_VOFSmoothEvap.so: undefined reference to `Foam::Vector<double>::typeName' collect2: error: ld returned 1 exit status make: *** [/home/ag600/OpenFOAM/OpenFOAM-7/platforms/linux64GccDPInt32Opt/bin/myInterFoamVOFSmoothEvap7] Error 1 Code:
EXE_INC = \ -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(WM_PROJECT_USER_DIR)/src_myInterFoamVOFSmoothEvap7/interfaceProperties/lnInclude \ -I$(WM_PROJECT_USER_DIR)/src_myInterFoamVOFSmoothEvap7/twoPhaseProperties/lnInclude \ -I$(WM_PROJECT_USER_DIR)/src_myInterFoamVOFSmoothEvap7/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 \ -I$(LIB_SRC)/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ -L$(FOAM_USER_LIBBIN) \ -lmyinterfaceProperties_VOFSmoothEvap \ -lmytwoPhaseProperties_VOFSmoothEvap \ -lmytwoPhaseProperties_VOFSmoothEvap \ -lmytwoPhaseMixture_VOFSmoothEvap \ -limmiscibleIncompressibleTwoPhaseMixture \ -lturbulenceModels \ -lincompressibleTurbulenceModels \ -lfiniteVolume \ -ldynamicFvMesh \ -ltopoChangerFvMesh \ -lfvOptions \ -lmeshTools Thank you all in advance! |
|
April 27, 2020, 03:11 |
|
#2 |
Senior Member
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 16 |
Hello,
Move part from FOAM_USER_LIBBIN to your libraries below OF libraries. |
|
April 27, 2020, 05:39 |
|
#3 |
New Member
Francesco Latella
Join Date: Apr 2020
Location: Bergamo, Italy
Posts: 15
Rep Power: 6 |
Hi Yogesh, thank you for the reply.
I have already did that. I have these libraries inside the folder $FOAM_USER_LIBBIN and inside the lib folder of OpenFOAM, and is not working |
|
April 27, 2020, 05:56 |
|
#4 |
New Member
Francesco Latella
Join Date: Apr 2020
Location: Bergamo, Italy
Posts: 15
Rep Power: 6 |
I'm thinking about that and I'm wondering if this "undefined reference to" error is due by the fact that this library is created by another person and is not an original one of OpenFOAM so I need first to compile her and only after do the wmake to the solver?
|
|
April 27, 2020, 10:43 |
|
#5 |
New Member
Francesco Latella
Join Date: Apr 2020
Location: Bergamo, Italy
Posts: 15
Rep Power: 6 |
Hi guys, I tried removing the three libraries that gave me that "undefined reference to" error and now it compile! But this is something really strange that I'm not able to understand...I've just one explanation and please tell me if I'm wrong.
If the solver is compiled also without those libraries, it means that they are not needed by the solver, am I right? So, maybe, should work, no? |
|
Tags |
libraries, library, undefined reference, wmake error, wmake problems |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.com] An Error in recompiling of openFoam-4.0 | alimea | OpenFOAM Installation | 4 | April 8, 2020 15:44 |
wmake problems during custom utility compilation | palazi88 | OpenFOAM Programming & Development | 11 | August 13, 2018 21:52 |
Simple piston movement in cylinder- fluid models | arun1994 | CFX | 4 | July 8, 2016 03:54 |
Error in compiling new drag model | k.farnagh | OpenFOAM Programming & Development | 13 | May 21, 2016 04:08 |
G95 + CGNS | Bruno | Main CFD Forum | 1 | January 30, 2007 01:34 |