Including external libraries [message #209871] |
Sat, 16 February 2008 13:49 |
Eclipse User |
|
|
|
Originally posted by: carlon.luca.email.it
Hi! Sorry for this trivial problem, but I can't seem to be able to solve.
I followed the manual and I added an external library. I added in the
project properties the path the the libraries and to the related include
files. In the project directory I got the header opencv/cv.h in the
include directory, as I expected. After I build anyway, I get this in the
console window:
make all
g++ -O2 -g -Wall -fmessage-length=0 -c -o Prova.o Prova.cpp
Prova.cpp:11:23: error: opencv/cv.h: No such file or directory
make: *** [Prova.o] Error 1
I can't see any -l parameter. What did I do wrong? Am I missing something?
In my source code I wrote:
#include <opencv/cv.h>
With an old version of CDT I had no problem in doing this, but I did it in
a different way. Am I lacking something to add this library?
Thanks! And sorry for the trivial question but even reading old posts I
couldn't find what is my mistake.
|
|
|
Re: Including external libraries [message #209887 is a reply to message #209871] |
Sat, 16 February 2008 17:54 |
Eclipse User |
|
|
|
Originally posted by: jim.marshall.wbemsolutions.com
Luca Carlon wrote:
> Hi! Sorry for this trivial problem, but I can't seem to be able to
> solve. I followed the manual and I added an external library. I added in
> the project properties the path the the libraries and to the related
> include files. In the project directory I got the header opencv/cv.h in
> the include directory, as I expected. After I build anyway, I get this
> in the console window:
>
> make all g++ -O2 -g -Wall -fmessage-length=0 -c -o Prova.o Prova.cpp
> Prova.cpp:11:23: error: opencv/cv.h: No such file or directory
> make: *** [Prova.o] Error 1
>
> I can't see any -l parameter. What did I do wrong? Am I missing something?
> In my source code I wrote:
>
> #include <opencv/cv.h>
>
> With an old version of CDT I had no problem in doing this, but I did it
> in a different way. Am I lacking something to add this library?
> Thanks! And sorry for the trivial question but even reading old posts I
> couldn't find what is my mistake.
>
The error message is saying that the compiler can not find the header
file (not a library). You need to ensure that your include path (the -I
option) has the top level directory (e.g. if your structure is like
this, myProgs/include/opencv then you need to specify myProgs/include in
the include path).
hth
|
|
|
Re: Including external libraries [message #209909 is a reply to message #209887] |
Sun, 17 February 2008 03:27 |
Eclipse User |
|
|
|
Originally posted by: carlon.luca.email.it
Yes, sorry. I mean that I added both my headers and my libraries. This is
what I have in my include paths (in the project properties):
/opt/local/include
and in fact I have on the filesystem:
/opt/local/include/opencv/cv.h
I can't understand why cv.h cannot be found. Is this ok?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03657 seconds