Linking to GSL from visual studio

I have installed GSL-1.14 from:
http://wiki.rglab.org/index.php?title=Public:Installation_of_GSL_from_Windows_binary

But I have problem in linking to it. Basically what I have got is a gsl-1.14 directory which includes following folders and files:

bin

libgsl-0.dll, libgslcblas-0.dll

lib

libgsl.a, libgsl.dll.a, libgsl.la
libgslcblas.a, libgslcblas.dll.a, libgslcblas.la


include

of course the include directory includes all the header files.

The problem is that I do not find any .lib file and I do not know what .a, .dll.a, .la files are. From an older installation of GSL I could get .lib files and could correctly link to them but with above files I do not know how I should work.

I am using Visual studio 2010.

Thanks for your help
Last edited on
Rename the *.dll.a to *.lib. You can safely delete the *.la files.
The code compiles and runs but crashes with the following message:

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
Did you do something stupid like improperly casting function pointers? If not, then I can't help you. You might want to ask what's wrong in a forum dedicated to the library.
I am sure the error has something to do with linking,
anyway this is my code that crashes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <cstdio>

#include <iostream>

#include <gsl/gsl_sf_bessel.h>

#include <gsl/gsl_blas.h>



int main(){

	double x = 5.0;

	double y = gsl_sf_bessel_J0 (x);

	printf ("J0(%g) = %.18e\n", x, y);





	double a[] = { 0.11, 0.12, 0.13,

	0.21, 0.22, 0.23 };



	double b[] = { 1011, 1012,

	1021, 1022,

	1031, 1032 };



	double c[] = { 0.00, 0.00,

	0.00, 0.00 };



	gsl_matrix_view A = gsl_matrix_view_array(a, 2, 3);

        gsl_matrix_view B = gsl_matrix_view_array(b, 3, 2);

	gsl_matrix_view C = gsl_matrix_view_array(c, 2, 2);



	gsl_blas_dgemm (CblasNoTrans, CblasNoTrans,

	1.0, &A.matrix, &B.matrix,

	0.0, &C.matrix);

	printf ("[ %g, %g\n", c[0], c[1]);

	printf (" %g, %g ]\n", c[2], c[3]);



	std::cin >> x;

	return 0;

}
I don't see anything obviously wrong with the code.

I am sure the error has something to do with linking
Why?
Topic archived. No new replies allowed.