GSL linking error using Dev-C++ 5

Aug 5, 2008 at 12:20pm
Hi Every One,

I would like to use the GSL library in an assignment. Using Dev C++ 4.9.9.2 as an IDE, I converted the 'An Example Program' from gsl-ref.pdf to make sure it gives me the required output (J0(5) = -1.775967713143382920e-01) but it did not.

The following is my Compile Log output:

Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\SNAS\Desktop\kwesi\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\SNAS\Desktop\kwesi\Makefile.win" all
g++.exe -c BesselTestSource1.cpp -o BesselTestSource1.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" lgsl g++.exe: lgsl: No such file or directory make.exe: *** [BesselTestSource1.o] Error 1 Execution terminated

The code listing used is given below:

#include <cstdlib>
#include <iostream>
#include <gsl/gsl_sf_bessel.h>

using namespace std;

int main(){
double x = 5.0;
double y=gsl_sf_bessel_J0(x);
cout << "J0 =" << scientific <<y << endl << endl;
system("PAUSE");
return 0;
}
Aug 5, 2008 at 2:31pm
Your make file may be corrupted. Delete it and recompile.
Aug 5, 2008 at 5:44pm
Thanks for your reply QWERTYman.
Anyway were you referring to the makefile located at C:\Documents and Settings\SNAS\Desktop\kwesi\Makefile.win.
For it did not work. Is there any other way?
Aug 5, 2008 at 5:58pm
Ehh...
Never done projects but once, so I dunno.
Aug 5, 2008 at 6:53pm
Are you saying I should compile the BesselTestSource1.cpp as a stand alone file.

Well, I jest did that and it works.

Process:
I installed the GSL into the Dev-C++ folder so the following chages were made in the compiler option:

The following commands were added when calling the compiler -lgsl -lgslcblas -lm and in the c++ includes the path to gsl was given.

Thanks for the hint.
Aug 5, 2008 at 7:18pm
That wasn't a hint, but a statement that I didn't know.

But...
Glad that I could help even though...I...didn't...try.
Aug 5, 2008 at 11:42pm
Yah, its a statement but the word projects got me thinking in the above direction. Anyway, it has the disadvantage of not been able to add other files to it. Its not a project.
Topic archived. No new replies allowed.