Reputation: 45
I am a new guy in C++ and using eclipse interface for practicing.
I am trying to add library such as :fft.hpp but when I put it on the top:
#include <iostream>
#include <fftw3.h>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <exception>
#include <complex>
#include "fft.hpp" // right here
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
it showed the error:
make: *** [src/test7.o] Error 1
fatal error: fft.hpp: No such file or directory
recipe for target 'src/test7.o' failed
I know that I added wrong directory but I do not know how to correct it.
Can anyone help?
Thank you very much.
Upvotes: 2
Views: 1002
Reputation: 155
This (#include "fft.hpp") is not library. It's header's file perhaps for your library. You should do right-click on your project name and go to menu "Properties". Then go to C/C++ General and select Paths and Symbols. There are you can find several tabs where you will be able to add your custom path to your Include (headers .h or .hpp) files and for Libraries (.o .so). In this case you will be able to use directive looks like this #include < fft.hpp >
Upvotes: 2