I am newbie to C++ for scientific computing. I have a problem with compiling my code. I installed GSL from Gnuwin32 in its default location (C:\Program Files) and tried to compile a sample program form the GNU help manual. Although the code itself is not the problem, I have pasted it below. It seems like my Borland C++ compiler is unable to read the header files.
include<iostream.h>
#include <gsl/gsl_sf_bessel.h>
int main (void)
{double x = 5.0;
double y = gsl_sf_bessel_J0 (x);
printf ("J0(%g) = %.18e\n", x, y);
return 0; }
I store the above as temp.cpp in my C:\ and compile using
Error E2209 temp.cpp 2: Unable to open include file 'gsl/gsl_sf_bessel.h'
Error E2268 temp.cpp 8: Call to undefined function 'gsl_sf_bessel_J0' in function main()
I use Windows XP and adding the GNuwin32\include\gsl directory to the PATH variable in the user variables does not help either. Any help is appreciated. It seems like I am missing a step somewhere in linking my BCC compiler and the GSL directory.
Regards
Kris.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
in your case the gsl_sf_bessel.h header file is searched in c:\Progra~1\GnuWin32\include\gsl\gsl directory (double gsl - one from -I an the other from #include), which is wrong.
Try with
C:> bcc32 -Ic:\Progra~1\GnuWin32\include temp.cpp
Borut
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I am newbie to C++ for scientific computing. I have a problem with compiling my code. I installed GSL from Gnuwin32 in its default location (C:\Program Files) and tried to compile a sample program form the GNU help manual. Although the code itself is not the problem, I have pasted it below. It seems like my Borland C++ compiler is unable to read the header files.
include<iostream.h>
I store the above as temp.cpp in my C:\ and compile using
C:> bcc32 -Ic:\Progra~1\GnuWin32\include\gsl temp.cpp
The error message I get is:
Error E2209 temp.cpp 2: Unable to open include file 'gsl/gsl_sf_bessel.h'
Error E2268 temp.cpp 8: Call to undefined function 'gsl_sf_bessel_J0' in function main()
I use Windows XP and adding the GNuwin32\include\gsl directory to the PATH variable in the user variables does not help either. Any help is appreciated. It seems like I am missing a step somewhere in linking my BCC compiler and the GSL directory.
Regards
Kris.
Can not open this link:
http://gnuwin32.sourceforge.net/packages/gsl.htm
please check it out?
It works for me.
Kris,
in your case the gsl_sf_bessel.h header file is searched in c:\Progra~1\GnuWin32\include\gsl\gsl directory (double gsl - one from -I an the other from #include), which is wrong.
Try with
C:> bcc32 -Ic:\Progra~1\GnuWin32\include temp.cpp
Borut
Thanks Borut. It now says:
Error: Unresolved external '_gsl_sf_bessel_J0' referenced from C:\TEMP.OBJ
Hi,
Did you find the solution of this porblem... I am also getting the samen error "unresolved external'gsl_sf_bessel_j0' reference
I would really appreciate your help.
Cheers,
Did you compile with the preprocessor symbol GSL_DLL defined (see http://gnuwin32.sourceforge.net/packages/gsl.htm)?