user3116431
user3116431

Reputation: 283

How to set Eclipse Library paths?

I am trying to get MLPack to work in Eclipse, but have some problems with including a header file.

I manage to read a header file in Eclipse

#include <neighbor_search.hpp>

This header file calls itself #include <mlpack/core.hpp>. I included in Eclipse in the library path the path just upto mlpack/core.hpp, i.e. /usr/include/MLPack/mlpack-1.0.8/src in the includes tab of paths and symbols.

I get the error message though: /usr/include/MLPack/mlpack-1.0.8/src/mlpack/methods/neighbor_search/neighbor_search.hpp:26:27: fatal error: mlpack/core.hpp: No such file or directory

 #include <mlpack/core.hpp>

How do set my path correctly so that <mlpack/core.hpp> will be found?

Upvotes: 0

Views: 984

Answers (2)

Jidgdoi
Jidgdoi

Reputation: 63

I also use MLPack (but not in Eclipse) and had this error. To resolve this problem you have to specify to GCC where the files of mlpack are. The thing is when you include a header file with #include <file.h> , GCC looks in these directory :

 /usr/local/include
 libdir/gcc/target/version/include
 /usr/target/include
 /usr/include

So what I did is create a soft link in /usr/include/ to the mlpack directory :

cd /usr/include/
sudo ln -s /full/path/to/the/mlpack/folder/ mlpack

Like that the GCC will have access to mlpack directory.

You'll have to download and install at least these 2 libraries (if you don't have them) : boost and armadillo.

Personally I also had to create a soft link for the libxml library :

cd /usr/include/
sudo ln -s /usr/libxml2/libxml/ libxml

I'm a bit in late to answer, but I hope it'll help further people !

Upvotes: 1

egh3
egh3

Reputation: 1

http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Freference%2Fcdt_u_prop_general_pns_libpath.htm

Project Properties -> C/C++ General category -> Paths and symbols -> Includes tab

Upvotes: 0

Related Questions