I have a c++ project in Eclipse Neon with Ubuntu 16.04 configured to use opencv. The project seemend to be correctly (i.e: opencv is not the issue :-) ) configured until I created a new class in the project and tried to use it from main.
The IDE seems to know my class 'Calculaflujos' exists, as the autocomplete features displays a list of the class methods. However, when I try to build the project it says (lower part of screenshot): 'fatal error: Calculaflujos.cpp, no such file or directory'.
I have very little experience with c++ and the make file has been generated by Eclipse.
Any ideas why this might be happening?
Thank you.
A few things going on here:
.h
file from another .cpp
file.<>
type includes, which means it will not consider files in the current directory. Either use ""
or add src
to your include path.A concrete little example:
$ cat a.h
/* stuff in header file */
$ cat quotes.cc
#include "a.h"
$ cat gtlt.cc
#include <a.h>
$ g++ -c quotes.cc
$ g++ -c gtlt.cc
gtlt.cc:1:15: fatal error: a.h: No such file or directory
#include <a.h>
^
compilation terminated.
$ g++ -c gtlt.cc -I .