N
Nena
Hi there,
I'm trying to include the Numerical Recipes for C++
for the Dev-C++ Editor Version.
But so far I've failed.
Therefore I've copied all head-files (for example nr.h)
into the folder where my program is. When compiling my
program two windows are poping up.
The first one is saying "Total errors 0" and "Size of
output file: 0".
And the second window behind the first one is a
"compiler and linker output" with the following two
lines
C:\DOKUME~1\LOKALE~1\Temp\ccyQaaaa.o(.text+0x2fc):lambda~1.cpp:
undefined reference to `NR::gammln(double)'
C:\DOKUME~1\LOKALE~1\Temp\ccyQaaaa.o(.text+0x317):lambda~1.cpp:
undefined reference to `NR::gammln(double)'
Here is my program where I'm trying to calculate
the simple binomial coefficient
#include<iostream>
#include<cstdlib>
#include<iomanip>
#include "nr.h" // include Numerical Recipes
#include<math.h>
#include<cmath>
using namespace std;
using namespace NR;
double myBino(DP n, DP k);
int main()
{
return 0;
}
double myBino(DP n, DP k)
{
double value = 0;
value = exp(gammln(n + 1.) - gammln(k + 1.));
cout << myBino(10, 6);
return value;
}
Could someone help me? I don't know exactly where to
look to fix my problem to get the program to work.
Many thanks!
Nena
I'm trying to include the Numerical Recipes for C++
for the Dev-C++ Editor Version.
But so far I've failed.
Therefore I've copied all head-files (for example nr.h)
into the folder where my program is. When compiling my
program two windows are poping up.
The first one is saying "Total errors 0" and "Size of
output file: 0".
And the second window behind the first one is a
"compiler and linker output" with the following two
lines
C:\DOKUME~1\LOKALE~1\Temp\ccyQaaaa.o(.text+0x2fc):lambda~1.cpp:
undefined reference to `NR::gammln(double)'
C:\DOKUME~1\LOKALE~1\Temp\ccyQaaaa.o(.text+0x317):lambda~1.cpp:
undefined reference to `NR::gammln(double)'
Here is my program where I'm trying to calculate
the simple binomial coefficient
#include<iostream>
#include<cstdlib>
#include<iomanip>
#include "nr.h" // include Numerical Recipes
#include<math.h>
#include<cmath>
using namespace std;
using namespace NR;
double myBino(DP n, DP k);
int main()
{
return 0;
}
double myBino(DP n, DP k)
{
double value = 0;
value = exp(gammln(n + 1.) - gammln(k + 1.));
cout << myBino(10, 6);
return value;
}
Could someone help me? I don't know exactly where to
look to fix my problem to get the program to work.
Many thanks!
Nena