|
[Sponsors] |
custom code compilation error: library linking problem |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 10, 2014, 06:16 |
custom code compilation error: library linking problem
|
#1 |
Member
nadine moussa
Join Date: Mar 2012
Posts: 30
Rep Power: 14 |
Hello there,
I developed a new code (porousSolidificationtheta) based on interFoam, and changed the interfaceproperties library of transportModel, so I copied transport Model and relocated in my WM_PROJECT_USER_DIR)/src/ and renamed the library as libmyinterfaceproperties and compiled it after changing th Make/files as follow: LIB = $(FOAM_USER_LIBBIN)/libmyinterfaceProperties the library was correctly compiled : '/home/nadine/OpenFOAM/nadine-2.0.1/platforms/linux64GccDPOpt/lib/libmyinterfaceProperties.so' is up to date. then in my code (porousSolidificationtheta directory I changed the make/options as follow: EXE_INC = \ -I$(WM_PROJECT_USER_DIR)/src/transportModels/interfaceProperties/lnInclude \ EXE_LIBS = \ -L$(FOAM_USER_LIBBIN) \ -llibmyinterfaceProperties \ and compiled using wmake, but got this error message: g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/nadine/OpenFOAM/nadine-2.0.1/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam201/src/transportModels -I/opt/openfoam201/src/transportModels/incompressible/lnInclude -I/opt/openfoam201/src/turbulenceModels/incompressible/turbulenceModel -I/opt/openfoam201/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam201/src/OpenFOAM/lnInclude -I/opt/openfoam201/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/porousSolidificationtheta.o -L/opt/openfoam201/platforms/linux64GccDPOpt/lib \ -L/home/nadine/OpenFOAM/nadine-2.0.1/platforms/linux64GccDPOpt/lib -llibmyinterfaceProperties -ltwoPhaseInterfaceProperties -lincompressibleTransportModels -lincompressibleTurbulenceModel -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -lOpenFOAM -ldl -lm -o /home/nadine/OpenFOAM/nadine-2.0.1/platforms/linux64GccDPOpt/bin/porousSolidificationtheta /usr/bin/ld: cannot find -llibmyinterfaceProperties collect2: ld returned 1 exit status make: *** [/home/nadine/OpenFOAM/nadine-2.0.1/platforms/linux64GccDPOpt/bin/porousSolidificationtheta] Error 1 I dont get how it doesnt find llibmyinterfaceProperties even though it s compiled correctly?!? any ideas?!? thank you all |
|
October 10, 2014, 10:04 |
|
#2 |
Member
Join Date: Nov 2011
Location: Berlin
Posts: 31
Rep Power: 15 |
Hi,
just a guess, but maybe the error comes because of final backslash in option file ? -llibmyinterfaceProperties \ regards dzi |
|
October 10, 2014, 10:10 |
|
#3 |
Member
nadine moussa
Join Date: Mar 2012
Posts: 30
Rep Power: 14 |
Hello dzi,
I actually wrote what I changed in the options file, the whole file contains the following: EXE_INC = \ -I$(WM_PROJECT_USER_DIR)/src/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -L$(FOAM_USER_LIBBIN) \ -llibmyinterfaceProperties \ -ltwoPhaseInterfaceProperties \ -lincompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume so the blackslash isnt the problem, but thank you for being intrested in my thread. Nadine |
|
October 10, 2014, 10:33 |
|
#4 |
Member
Join Date: Nov 2011
Location: Berlin
Posts: 31
Rep Power: 15 |
or it is maybe because of lib naming,
what happens if you try : -lmyinterfaceProperties \ instead of -llibmyinterfaceProperties ? |
|
October 10, 2014, 10:50 |
|
#5 |
Member
nadine moussa
Join Date: Mar 2012
Posts: 30
Rep Power: 14 |
hey dzi,
cannot believe it!!! it worked! as simple as that! just changed the name as u suggested and it worked! I lost 2 days on this!!! thank you |
|
October 10, 2014, 10:58 |
|
#6 |
Member
Join Date: Nov 2011
Location: Berlin
Posts: 31
Rep Power: 15 |
perfect
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem compiling a custom Lagrangian library | brbbhatti | OpenFOAM Programming & Development | 2 | July 7, 2014 12:32 |
code compilation problem with wmake | bmikuz | OpenFOAM Programming & Development | 2 | October 17, 2012 10:30 |
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) | Yogini | Fluent UDF and Scheme Programming | 7 | October 3, 2012 08:24 |
State of the art in CFD technology | Juan Carlos GARCIA SALAS | Main CFD Forum | 39 | November 1, 1999 15:34 |
What kind of Cmmercial CFD code you feel well? | Lans | Main CFD Forum | 13 | October 27, 1998 11:20 |