Dear visitor, welcome to QtForum.org.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
Problem with OpenCV
Hi every body
I have à problem, when compilling my project i have this message :
.obj/form1.o: In function `Form1::openpic()':.ui/../form1.ui.h:28: référence indéfinie vers « cvLoadImage »
collect2: ld a retourné 1 code d'état d'exécution
make: *** [T] Erreur 1
its seems to be due to à linking problem !!!!
please help
HELLO ;)
RE: Problem with OpenCV
Hi,
Could you paste the code/file where you have the error?
Thanks
Maverick
Hi
this is my code :
-----------------------------------
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "/usr/local/include/opencv/cv.h"
#include "/usr/local/include/opencv/highgui.h"
void Form1::openpic()
{
IplImage* img = 0;
int height,width,step,channels;
uchar *data;
int i,j,k;
img=cvLoadImage("/media/data/job/fc.jpg");
}
--------------------------------------
Itry to do that thing:
#include "cv.h"
but i have many PBs tha's why i do :
#include "/usr/local/include/opencv/cv.h"
my /etc/ld.so.conf file look like :
--------------------------
include ld.so.conf.d/*.conf
/usr/local/lib
/usr/local/include/opencv
--------------------------
Please help !!!!!!
IE: this project is my FSP (Final Study Project)
THKS
HELLO ;)
This post has been edited 1 times, last edit by "Libertux" (Jul 3rd 2007, 4:44pm)
Hi,
Could you post your files please. We don't know wich classes are you defining.
Òscar Llarch i Galán
(\__/)
(O.o )
(> < )
hi
I tried to compile without QtDesigner (i compile the semples given with OpenCV) i use this script :
for i in *.cpp; do
echo "compilling...$i"
g++ -ggdb `pkg-config --cflags opencv` -o `basename $i .cpp` $i `pkg-config --libs opencv`;
done
and its work normaly !!!! what should i do to success the compilation with QtDesigner ?
HELLO ;)
Hi,
You are compiling all your cpp files, but designer makes some other files.
Have you tryied to use "qmake" as described into qt manuals? Probably you will have to edit the ".pro" file to adapt it to use the OpenCV libs.
Òscar Llarch i Galán
(\__/)
(O.o )
(> < )
Hello
thats what i'm doing during around 3 hours my .pro file look like :
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
TEMPLATE = app
LANGUAGE = C++
CONFIG += qt warn_on release
LIBS += ~/local/lib [COLOR=blue] // <--------I add THIS[/COLOR]
LIBS += ~/local/bin [COLOR=blue] // <--------I add THIS[/COLOR]
LIBS += ~/local/lib/pkgconfig [COLOR=blue] // <--------I add THIS[/COLOR]
INCLUDEPATH += ~/local/include/opencv [COLOR=blue] // <--------I add THIS[/COLOR]
SOURCES += main.cpp
FORMS = form1.ui
IMAGES = images/filenew \
images/fileopen \
images/filesave \
images/print \
images/undo \
images/redo \
images/editcut \
images/editcopy \
images/editpaste \
images/searchfind
unix {
UI_DIR = .ui
MOC_DIR = .moc
OBJECTS_DIR = .obj
}
|
but i had the same Error :
|
Source code
|
1
2
3
4
|
.ui/../form1.ui.h:15:16: erreur: cv.h : Aucun fichier ou répertoire de ce type
.ui/../form1.ui.h:16:21: erreur: highgui.h : Aucun fichier ou répertoire de ce type
/usr/lib/qt-3.3/include/qtooltip.h:86: attention : ‘class QToolTip’ has virtual functions but non-virtual destructor
make: *** [.obj/form1.o] Erreur 1
|
please any suggestion
HELLO ;)
This post has been edited 1 times, last edit by "Libertux" (Jul 4th 2007, 1:46am)