PDA

View Full Version : Adding a library search path on Eclipse using QT Eclipse Integration



battousaihimura
16th November 2007, 20:24
Well, I am developing a computer vision application on Eclipse using OpenCV and QT Eclipse Integration.
To use OpenCV, its necessary to add an library search path and some libraries to the GCC C++ linker. When I was using only OpenCV, it was fine, but when I try to do this on a QT Project, the project properties interface changes, and don't show these properties anymore... so I can't set then.
So... someone know a way to set the libraries search path and linker?
Thanks.

jpn
16th November 2007, 21:02
I don't know about eclipse integration since I never used it, but with qmake that would be INCLUDEPATH (http://doc.trolltech.com/4.3/qmake-variable-reference.html#includepath) and LIBS (http://doc.trolltech.com/4.3/qmake-variable-reference.html#libs).

battousaihimura
18th November 2007, 16:55
Thanks jpn, you solved my problems. :D

derektaprell
27th January 2009, 10:05
Hi Everyone,

Can anybody please elaborate on this? I am having the same problem and cant find where to add the openCV directories, libraries and searchpath.

I have a QT program and an openCV program that work and just cant get them to play nice together. I made a normal C++ project for the openCV and used the QT GUI project for the QT project.

I followed the instructions on this site (http://www.brindusescu.org/?q=node/26) but I keep getting "cant find -lcxcore".

Here is my current project file.

TEMPLATE = app
TARGET = thesis2
QT += core \
gui \
sql \
network \
opengl
HEADERS += thesis2.h
SOURCES += main.cpp \
thesis2.cpp
FORMS += thesis2.ui
RESOURCES +=
INCLUDEPATH += "C:\Program Files\OpenCV\cxcore\include" \
"C:\Program Files\OpenCV\cv\include" \
"C:\Program Files\OpenCV\cvaux\include" \
"C:\Program Files\OpenCV\otherlibs\highgui"
LIBS += -L/usr/local/lib \
-lcxcore \
-lcv \
-lhighgui \
-lcvaux

Thanks for any help.

jpn
27th January 2009, 11:46
Add

win32:LIBS += -L"C:\Program Files\OpenCV\cxcore\lib"
(or wherever the lib is).

derektaprell
28th January 2009, 01:57
Thanks JPN. All in working order now.

For anyone wanting the project files lines they are:


INCLUDEPATH += "C:\Program Files\OpenCV\cxcore\include" \
"C:\Program Files\OpenCV\cv\include" \
"C:\Program Files\OpenCV\cvaux\include" \
"C:\Program Files\OpenCV\otherlibs\highgui" \
"C:\Program Files\OpenCV\cxcore\include"
win32:LIBS += -L"C:\Program Files\OpenCV\lib"
LIBS += -lcv \
-lcvaux \
-lhighgui \
-lcxcore

DjRAST
4th March 2009, 15:33
Hi @ all,
thanks a lot for the replies on this topic! I had the same problem and also managed to create a combined QT/OpenCV-Project. My only issue now is that Auto-Completion does not work in this project for OpenCV primitives and functions. Furthermore, Eclipse remarks OpenCV include statements with "unresolved inclusion" (but builds the project perfectly...).
Is there any way to fix this, so i can use Auto-Completion for both, QT and OpenCV :confused:

nadeeshani
22nd December 2010, 09:13
Hi All,

Thanks a lot for the post. I also had the same problem of linking opencv with qt and now the problem solved :). In my case I had to write -lcv210 instead of -lcv, because lib folder contains libraries like that.