Linker error for nrutil functions in C


dai_bach
09-06-2006, 04:51 AM
I continually get error messages such as

[Linker error] undefined reference to `function'

for all NR functions I try to use. I have done

#include "nr.h"
#include "nrutil.h"

but my compiler (Dev C++ v4.9.9.2) doesn't seem to recognise them.

Any advice?

Saul Teukolsky
09-06-2006, 08:45 AM
You also have to compile and link nrutil.c with your program.

Saul Teukolsky

torres
04-02-2008, 12:42 PM
Sorry, I don´t explain in english very well. But I try it ¡¡ .

Finding solutions to my problem, I arrived to this forum and I think can help you.

To compile my program with g++ and Dev C++ I had a problem seems you (whith function ran2) and resolve it with:

#include <iostream>
#include "./nr.h"
#include "./ran2.cpp" (adding source code to de function/s that you uses in the program)

and compile my program with g++ and run it.
I hope help you ...