PDA

View Full Version : finding .h files.




farmerdoug
Jan 20, 2012, 01:35 PM
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.



willieva
Jan 20, 2012, 01:59 PM
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.

thundersteele
Jan 20, 2012, 02:00 PM
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.

farmerdoug
Jan 20, 2012, 02:08 PM
thanks

farmerdoug
Jan 20, 2012, 07:30 PM
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

jiminaus
Jan 20, 2012, 07:42 PM
Click on your project in the project navigator.
Click on your target in the project editor.
Go into the Build Phases
Expand Link Binary With Libraries
Add your libraries here

farmerdoug
Jan 21, 2012, 06:16 AM
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.

farmerdoug
Jan 21, 2012, 06:52 AM
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