Menu

GSL: Header files not being read

Help
Kris
2008-11-13
2012-07-26
  • Kris

    Kris - 2008-11-13

    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>

    #include &lt;gsl/gsl_sf_bessel.h&gt;
    int main (void)
    {double x = 5.0;
      double y = gsl_sf_bessel_J0 (x);
      printf (&quot;J0(%g) = %.18e\n&quot;, x, y);
      return 0;    }
    

    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.

     
    • Thien Bao

      Thien Bao - 2009-05-15

      Can not open this link:
      http://gnuwin32.sourceforge.net/packages/gsl.htm

      please check it out?

       
      • GnuWin

        GnuWin - 2009-05-18

        It works for me.

         
    • Borut Ražem

      Borut Ražem - 2008-11-14

      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

       
    • Kris

      Kris - 2008-11-14

      Thanks Borut. It now says:

      Error: Unresolved external '_gsl_sf_bessel_J0' referenced from C:\TEMP.OBJ

       
      • hami

        hami - 2009-05-10

        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,

         
        • GnuWin

          GnuWin - 2009-05-14

          Did you compile with the preprocessor symbol GSL_DLL defined (see http://gnuwin32.sourceforge.net/packages/gsl.htm)?

           
MongoDB Logo MongoDB