CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Undefined reference (http://www.cfd-online.com/Forums/openfoam-solving/58996-undefined-reference.html)

mateusz_slowikowski March 27, 2008 16:42

Hi All, I want to calculate
 
Hi All,

I want to calculate the upper incomplete gamma function, which I have as a function inside a new model, and use it for further applications. However, I'm running into this error:

/home/slowiko/OpenFOAM/slowiko-1.4/lib/linux64Gcc4DPOpt/libnewModel.so: undefined reference to `Foam::newModel::gammaL(double, Foam::GeometricField<double,>&)'
collect2: ld returned 1 exit status
make: *** [/home/slowiko/OpenFOAM/slowiko-1.4/applications/bin/linux64Gcc4DPOpt/testFoam] Error 1

when I go into the ~/newmodel directory and do a "wmake libso" I don't get any errors. I also tried to "wclean" in the aforementioned directory before the "wmake libso" then a "./Allwmake" (and) a "wmake" after, however this doesn't seem to solve my problem. Any suggestions?

stephan March 28, 2008 05:14

hi, did you use the "static
 
hi,

did you use the "static" keyword somewhere in your class?
stephan

mateusz_slowikowski March 28, 2008 09:27

Basically, I'm doing some modi
 
Basically, I'm doing some modifications to the two phase euler foam code. This particular model is based on the structure of the phase model (a little more complicated, but similar structure)
the only "static" anything that I used was in the selector:

// Selectors
//- Return a reference to the selected new model
static autoPtr<newmodel> New
(
PtrList<volvectorfield>& U_temp,
PtrList<volscalarfield>& prprty_temp,
const IOdictionary& transdict,
const IOdictionary& prprtydict
);

mateusz_slowikowski March 28, 2008 09:34

I should probably say however:
 
I should probably say however: I was using a function under the same name earlier. I didn't need it, and deleted it. Later, I added a different function (the gamma function calculated a different way) back.

stephan March 28, 2008 17:39

hi, i thought it could be a
 
hi,

i thought it could be a problem with the definition and declaration of static members - which may cause similar errors.
stephan

hjasak March 28, 2008 21:03

Hello Mateusz, Your problem
 
Hello Mateusz,

Your problem is that the .C file containing function definition (function body) for

newModel::gammaL(double, Foam::GeometricField<double,>&)

either did not compile correctly or is not on a list of files but it exists in the header of the class newModel.

If you want to use it, it has got to be defined to make the linker happy; if you do not want it, delete its declaration from the header file.

Hope this helps,

Hrv

mateusz_slowikowski March 31, 2008 16:03

Hrv, Right on the money - I
 
Hrv,

Right on the money - I guess a mistake like that serves me right for trying to rush through the code while still being a newbie.. thanks again for the help.

Mateusz

zoptirik February 27, 2015 15:35

Quote:

Originally Posted by mateusz_slowikowski (Post 178702)
Hi All,

I want to calculate the upper incomplete gamma function, which I have as a function inside a new model, and use it for further applications. However, I'm running into this error:

/home/slowiko/OpenFOAM/slowiko-1.4/lib/linux64Gcc4DPOpt/libnewModel.so: undefined reference to `Foam::newModel::gammaL(double, Foam::GeometricField<double,>&)'
collect2: ld returned 1 exit status
make: *** [/home/slowiko/OpenFOAM/slowiko-1.4/applications/bin/linux64Gcc4DPOpt/testFoam] Error 1

when I go into the ~/newmodel directory and do a "wmake libso" I don't get any errors. I also tried to "wclean" in the aforementioned directory before the "wmake libso" then a "./Allwmake" (and) a "wmake" after, however this doesn't seem to solve my problem. Any suggestions?


I want to calculate the lower incomplete gamma function, which I have as a function inside a new model too. lower incomplete gamma functions includes a magnitude U. I tried to use gnu math functions but it gave me prameter type error. I stucked that error. Can you help me calculating incomplete gamma.

Best


All times are GMT -4. The time now is 15:05.