PDA

View Full Version : defining a secondary "searching folder" for external codes



szisziszilvi
10th May 2011, 14:32
Hi,

I have no idea actually for the proper keywords, so maybe it is enough to tell them if it is that easy.
I would like to use some codes in my application that were downloaded from alglib.net (these are headers and cpp-s). As I would like to use them in more projects it could be very efficient just to include them in the "old way" like
#include <wantedAlglibLibrary>
or at least to define somehow this secondary folder in which the compiler should searh for the included files. This is like when I add my own codes with the
#include "mycode.h"
but in this case the code will be searched in the project's folder. The problem is that in the alglib files similar include lines were written, so whilst compiling each will be searched in the project's folder. See my point?

Just to make it clear:
I have
d:/mypath/alglib/alglibsource.h --> there is #include "otheralglibsource.h"
d:/my_other_path/main.cpp --> there can be #include "d:/mypath/alglib/alglibsource.h"

but this will fail because in alglibsource.h there is simply "otheralglibsource.h" written instead of "d:/mypath/alglib/otheralglibsource.h"

so it would be nice to use it just like this:
d:/my_other_path/main.cpp --> #include "aglibsource.h"
or
d:/my_other_path/main.cpp --> #include <aglibsource.h>

high_flyer
11th May 2011, 15:17
so it would be nice to use it just like this:
d:/my_other_path/main.cpp --> #include "aglibsource.h"
or
d:/my_other_path/main.cpp --> #include <aglibsource.h>
you can.
Just set in each project the include search path.

szisziszilvi
12th May 2011, 11:04
lovely! :) Thank you very much. with a very little bit of search:
this one (http://www.qtcentre.org/threads/10233-Adding-a-library-search-path-on-Eclipse-using-QT-Eclipse-Integration) gave me the hint for the correct answer about INCLUDEPATH (http://doc.trolltech.com/latest/qmake-variable-reference.html#includepath)