Excel does not see DLL anymore when used with GSL working function

Hi, I am new to C++ and request kindly help. I need to link C++ with excel, I managed to program basic DLL's with basic functions exported to Excel (+, square, substraction, export arrays 1D).

Problem: I linked my DLL to the GSL Library and tried to use the Bessel function (I did link the libraries and checked from a console application that my dll bessel function exported from gsl worked).

The DLL is not found anymore in Excel as soon as I try to use the gsl exported function in my DLL. (The DLL is compiled fine, I have checked the linking to the GSL library and it works but Excel does not see the DLL anymore, whereas if I don't use the gsl bessel function by suppressing the soustraction function all the rest works again and Excel finds the DLL again: the addition and carrre functions work)

I use Vista & Visual Studio 2008

Here is my DLL code: (I put the bessel function in soustraction after modifying my original working real substraction function and as I mentioned this works when this DLL function is called from a console application, since I linked the gsl library properly to my DLL project)

#include "maDll.h";
#include <gsl/gsl_sf_bessel.h>;



double __stdcall carrre (double& arg)
{return arg*arg;}
double __stdcall addition (double& arg1, double& arg2)
{return arg1+arg2;}
double __stdcall soustraction (double& arg1, double& arg2)
{return gsl_sf_bessel_J0 (5);}




void __stdcall DoubleElements(double * tableau,double * tableau2, long lngNbItems)
{
long i;
for (i=0;i<lngNbItems;i++) {
tableau[i] = 2.13 * tableau[i];
tableau2[i] = gsl_sf_bessel_J0 (i+1);

}
}

VB: (it works if I don't use the gsl function)

Private Declare Function carrre _
Lib "C:\Users\ME\Documents\Visual Studio 2008\Projects\MaDll\Debug\MaDll.dll" (arg As Double) As Double

Private Declare Function addition _
Lib "C:\Users\ME\Documents\Visual Studio 2008\Projects\MaDll\Debug\MaDll.dll" _
(arg1 As Double, arg2 As Double) As Double

Private Declare Function soustraction _
Lib "C:\Users\ME\Documents\Visual Studio 2008\Projects\MaDll\Debug\MaDll.dll"; _
(arg1 As Double, arg2 As Double) As Double

Thank you, I have searched to be up to this point but now I am quite lost...
Topic archived. No new replies allowed.