 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Nena Guest
|
Posted: Sat Nov 11, 2006 9:30 am Post subject: Rubbish Output Dev-C Compiler / Program for Binomial Coeffic |
|
|
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 |
|
| Back to top |
|
 |
Nena Guest
|
Posted: Sat Nov 11, 2006 9:34 am Post subject: Re: Rubbish Output Dev-C Compiler / Program for Binomial Coe |
|
|
Nena wrote:
| Quote: | Hi there,
I'm trying to include the Numerical Recipes for C++
for the Dev-C++ Editor Version.
|
I've meant to say "Version 4". |
|
| Back to top |
|
 |
red floyd Guest
|
Posted: Sat Nov 11, 2006 10:10 am Post subject: Re: Rubbish Output Dev-C Compiler / Program for Binomial Coe |
|
|
Nena wrote:
| Quote: | 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.
|
Your main exits immediately. |
|
| Back to top |
|
 |
Mark P Guest
|
Posted: Sat Nov 11, 2006 10:11 am Post subject: Re: Rubbish Output Dev-C Compiler / Program for Binomial Coe |
|
|
Nena wrote:
| Quote: | 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
|
This is a compiler issue. Your code needs to be linked with the library
code-- the linker is basically saying that it doesn't see a definition
of the function NR::gammln( double) anywhere. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|