finding .h files.

Discussion in 'Mac Programming' started by farmerdoug, Jan 20, 2012.

  1. macrumors 6502a

    Joined:
    Sep 16, 2008
    #1
    I do not get an error message from this include in main.
    #include "./gsl-1.13/linalg/gsl_linalg.h"
    But in gsl_linalg.h this include


    #ifndef __GSL_LINALG_H__
    #define __GSL_LINALG_H__
    #include "./gsl-1.13/gsl_mode.h"
    gives me an error saying no such file or directory.
    Its there. I checked.
     
  2. macrumors 6502

    Joined:
    Mar 12, 2010
    #2
    gsl-1.13 is located where your main is, so the include statement finds gsl_linalg.h

    When the include statement from that file is read in, it is looking for gsl-1.13 relative to gsl_linalg.h, and can't find it because gsl-1.13 isn't where gsl_linalg.h is. gsl-1.13 is locate at ../../gsl-1.13 relative to gsl_linalg.h

    You could edit the gsl_linalg.h include statement to give it the proper path, or compile with -I. so the include path has the directory your main program is in.
     
  3. macrumors 68030

    Joined:
    Oct 19, 2011
    Location:
    Switzerland
    #3
    Have you tried giving the absolute path to the file?

    I installed GSL into the default directory, so I just have to
    #include <gsl/gsl_blah.h>

    Are you sure that gsl_mode.h is the correct file to include.
     
  4. thread starter macrumors 6502a

    Joined:
    Sep 16, 2008
    #4
    thanks
     
  5. thread starter macrumors 6502a

    Joined:
    Sep 16, 2008
    #5
    So I started from scratch.
    The #include seems to be right but I get linker errors which is not surprising ( I think) because I haven't told Xcode 4 where the libraries are. How do to I do that?
    thanks
     
  6. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #6
    1. Click on your project in the project navigator.
    2. Click on your target in the project editor.
    3. Go into the Build Phases
    4. Expand Link Binary With Libraries
    5. Add your libraries here
     
  7. thread starter macrumors 6502a

    Joined:
    Sep 16, 2008
    #7
    If I've followed your directions properly,everything under Add Build Phase is grey out.
    If I run what I have, (I just added everything that seem relavent to the project). It looks for files in Downloads when I moved and made the libraries in Documents.
     
  8. thread starter macrumors 6502a

    Joined:
    Sep 16, 2008
    #8
    Okay. Found the Build Phases. All the Libraries are there; I added them to the project in the project navigator. The program even runs to a point. Then I get this:

    0.000000 46.847527 50.790520 55.977997
    dyld: lazy symbol binding failed: Symbol not found: _cblas_dtrsv
    Referenced from: /usr/local/lib/libgsl.0.dylib
    Expected in: flat namespace

    dyld: Symbol not found: _cblas_dtrsv
    Referenced from: /usr/local/lib/libgsl.0.dylib
    Expected in: flat namespace
     

Share This Page