473,654 Members | 3,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rubbish Output Dev-C Compiler / Program for Binomial Coefficient

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\LOK ALE~1\Temp\ccyQ aaaa.o(.text+0x 2fc):lambda~1.c pp:
undefined reference to `NR::gammln(dou ble)'
C:\DOKUME~1\LOK ALE~1\Temp\ccyQ aaaa.o(.text+0x 317):lambda~1.c pp:
undefined reference to `NR::gammln(dou ble)'

Here is my program where I'm trying to calculate
the simple binomial coefficient

#include<iostre am>
#include<cstdli b>
#include<iomani p>
#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

Nov 11 '06 #1
7 3179
Nena wrote:
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".

Nov 11 '06 #2
Nena wrote:
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\LOK ALE~1\Temp\ccyQ aaaa.o(.text+0x 2fc):lambda~1.c pp:
undefined reference to `NR::gammln(dou ble)'
C:\DOKUME~1\LOK ALE~1\Temp\ccyQ aaaa.o(.text+0x 317):lambda~1.c pp:
undefined reference to `NR::gammln(dou ble)'

Here is my program where I'm trying to calculate
the simple binomial coefficient

#include<iostre am>
#include<cstdli b>
#include<iomani p>
#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.
Nov 11 '06 #3
Nena wrote:
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\LOK ALE~1\Temp\ccyQ aaaa.o(.text+0x 2fc):lambda~1.c pp:
undefined reference to `NR::gammln(dou ble)'
C:\DOKUME~1\LOK ALE~1\Temp\ccyQ aaaa.o(.text+0x 317):lambda~1.c pp:
undefined reference to `NR::gammln(dou ble)'

Here is my program where I'm trying to calculate
the simple binomial coefficient

#include<iostre am>
#include<cstdli b>
#include<iomani p>
#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.
Nov 11 '06 #4
Okay, thanks.
I'm C++ beginner. And how can I link my code with the library code?

Thanks!
Mark P wrote:
Nena wrote:
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\LOK ALE~1\Temp\ccyQ aaaa.o(.text+0x 2fc):lambda~1.c pp:
undefined reference to `NR::gammln(dou ble)'
C:\DOKUME~1\LOK ALE~1\Temp\ccyQ aaaa.o(.text+0x 317):lambda~1.c pp:
undefined reference to `NR::gammln(dou ble)'

Here is my program where I'm trying to calculate
the simple binomial coefficient

#include<iostre am>
#include<cstdli b>
#include<iomani p>
#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.
Nov 11 '06 #5
I've tried the following to link my code with the
library code under the Dev-C++ editor:

Options -Compiler options -Directories

Then I've added the path of my Numerical Recipes folder
into "C++ include files" and "Libraries directory".
Result: DOESN'T HELP!
I still obtain the same messages.

Aarrhhhhhhhh! Help!
Nena wrote:
Okay, thanks.
I'm C++ beginner. And how can I link my code with the library code?

Thanks!
Mark P wrote:
Nena wrote:
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\LOK ALE~1\Temp\ccyQ aaaa.o(.text+0x 2fc):lambda~1.c pp:
undefined reference to `NR::gammln(dou ble)'
C:\DOKUME~1\LOK ALE~1\Temp\ccyQ aaaa.o(.text+0x 317):lambda~1.c pp:
undefined reference to `NR::gammln(dou ble)'
>
Here is my program where I'm trying to calculate
the simple binomial coefficient
>
#include<iostre am>
#include<cstdli b>
#include<iomani p>
#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.
Nov 11 '06 #6
Nena wrote:
Mark P wrote:
>Nena wrote:
>>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\L OKALE~1\Temp\cc yQaaaa.o(.text+ 0x2fc):lambda~1 .cpp:
undefined reference to `NR::gammln(dou ble)'
C:\DOKUME~1\L OKALE~1\Temp\cc yQaaaa.o(.text+ 0x317):lambda~1 .cpp:
undefined reference to `NR::gammln(dou ble)'

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.
Okay, thanks.
I'm C++ beginner. And how can I link my code with the library code?

Thanks!
First, don't top-post-- reply below the message to which you're responding.

To your question, I don't know. You'll need to look at the
documentation for your compiler and perhaps also any info included with
the NR text. Generally you need to tell the compiler the name and
location of the library, but the details of this will depend on your
specific setup.

Normally I would say to find a discussion forum for your compiler, and
you might still try this, but Dev-C++ is sort of defunct at this point
and I don't know how much support you'll find. I'd suggest trying its
free successor, CodeBlocks, as you might find a more active community to
help you.
Nov 11 '06 #7
Nena wrote:
I've tried the following to link my code with the
library code under the Dev-C++ editor:

Options -Compiler options -Directories

Then I've added the path of my Numerical Recipes folder
into "C++ include files" and "Libraries directory".
Result: DOESN'T HELP!
I still obtain the same messages.

Aarrhhhhhhhh! Help!
That's only half of what you need. That's the location to look for the
library, but you haven't provided the name of the library. Take a look at:

http://www.uniqueness-template.com/devcpp/

Near the bottom, there's an item called "Using library files". Follow
the general instructions there and add the appropriate -l[libname] flags
to the linker.
Nov 11 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1865
by: DonMiche | last post by:
I'm having trouble producing an xml output from another xml file using xsl. The proper values are output to the browser as text with no formating or xml tags (<rowset> and <row>). Any ideas? (The xml source is available below) Here is my xsl:
3
6788
by: Peter Ammon | last post by:
Let's say I want to call a function but suppress what it writes to stdout. One way that works on my machine is this: #include <stdio.h> int main(void) { freopen("/dev/null", "w", stdout); puts("Hello"); return 0; }
7
1212
by: John Swan | last post by:
I am starting to really hate managed C++. Ok. I am trying to add a newline character to a std::string and it won't do it. Whenever you put in << endl or + endl it wont compile because the managed bit is shit.
7
12001
by: Brian Tkatch | last post by:
This is a shell question (bash), but i'm more familiar with this group, so i hope noone minds. I have a bash shell script which needs to query the database and return information into a variable. This can be done with a subshell, but that slows everything down because it is within a loop (and would be done mutiple times) and it would need a new login each time. As such, i got it to work via a temp file something like: db2 -xt +p <<...
14
1766
by: fdu.xiaojf | last post by:
Hi, I'm writing a program which imports an external module writing in C and calls a function provided by the module to do my job. But the method produces a lot of output to the stdout, and this consumes most of the running time. My question is, is there a way to depress the output produced by the function and hence make my program run faster? It's too complicated for me to modify the source code and recompile the external module.
3
2108
by: pnsreee | last post by:
Hi All, I am trying to print a log file created in the same script with the code bellow. but Im not getting output on screen. The output file is created using rediretion of output. open(STDOUT, ">flat.log") || die "Can't redirect stdout"; prinf " ----------------------------------------------\n";
4
4877
by: smashzone | last post by:
Hi all, Can anyone help me with a script to produce an output file of a "df -m" command with ";" seperators. I assume its very easy but I know nothing about Linux/Unix (I'm a newbie) That is: df -m $ df -m Filesystem 1M-blocks Used Available Use% Mounted on /dev/md0 9845 4881 4464 53% /
2
3093
by: jdbartlett | last post by:
I'm trying to capture output from a command line utility (XMLSec), but only get an empty result. If I call the script from the command line, I see XMLSec's output, but I can't seem to capture it! My PHP installation is working correctly and captures other command line output just fine, XMLSec is the only exception I've found. I've also tried a couple of other systems to confirm this behavior. Capture methods I've tried include:
0
1083
by: richard.slaymaker | last post by:
Hi All, I am outputting a table to a text file in Access 97 and the file I am get out contains a whole load of extra 'passing', see below: -------------------------------------------------------------------------- | detail | -------------------------------------------------------------------------- | FHEAD,
2
1151
by: pedalpete | last post by:
I've got a maintenance script that I run, and it takes quite a bit of time to run. On my dev machine, i can see the output as the script goes as I echo at certain points. On my production machine I get no output. I can see that the script is working because the files that need to get created are getting created, but I can't see the output. I've put ini_set('display_errors', '1');
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8708
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8594
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7307
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.