Realloc(): invalid pointer QT5.2 + OPENCV2.4.8 + UBUNTU13.10
-
wrote on 4 Mar 2014, 19:26 last edited by
Hello! I'm new and I'm having trouble compiling a project QT + OpenCV + Ubuntu ...
I searched several forums and found nothing
.PRO
@
QT += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = TesteQT
TEMPLATE = appINCLUDEPATH += /usr/local/include/opencv
LIBS += -L/usr/local/lib
LIBS += -lopencv_core
LIBS += -lopencv_imgproc
LIBS += -lopencv_highgui
LIBS += -lopencv_ml
LIBS += -lopencv_video
LIBS += -lopencv_features2d
LIBS += -lopencv_calib3d
LIBS += -lopencv_objdetect
LIBS += -lopencv_contrib
LIBS += -lopencv_legacy
LIBS += -lopencv_flann
LIBS += -lopencv_nonfreeSOURCES += main.cpp
mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui
@MAINWINDOW
@#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFileDialog>
#include <opencv/cv.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}MainWindow::~MainWindow()
{
delete ui;
}void MainWindow::on_btProcurar_clicked()
{
cv::namedWindow("Disp");
cv::VideoCapture cap(0);
cv::Mat frame;
do{
cap >> frame;
imshow("Disp",frame);
}while(cv::waitKey(30)<0);
cv::destroyAllWindows();
}
@When compiling the project with the error:
** Error in `/home/welinton/Documents/Projetos/QtProjetos/build-TesteQT-Desktop_Qt_5_2_1_GCC_64bit-Debug/TesteQT': realloc(): invalid pointer: 0x00007f6305316d80 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7f4c6)[0x7f63043ff4c6]
/lib/x86_64-linux-gnu/libc.so.6(realloc+0x300)[0x7f6304403cf0]
/home/welinton/Qt/5.2.1/gcc_64/lib/libQt5Core.so.5(_ZN9QListData7reallocEi+0x26)[0x7f6304d52016]
/home/welinton/Qt/5.2.1/gcc_64/lib/libQt5Core.so.5(_ZN9QListData6appendEi+0x65)[0x7f6304d520d5]...
The program has unexpectedly finished.
/home/welinton/Documents/Projetos/QtProjetos/build-TesteQT-Desktop_Qt_5_2_1_GCC_64bit-Debug/TesteQT crashed -
wrote on 18 Jun 2014, 10:18 last edited by
Hi,
I'm ecountered the same problem!
Anybody knows a solution?
Thnx.
-
wrote on 18 Jun 2014, 11:35 last edited by
hi again,
I solve the problem!
- complete remove opencv and qt
- Install opncv and qt following "this":https://code.google.com/p/qt-opencv-multithreaded/wiki/Documentation instrucions
- in your .PRO file put simply
LIBS +=pkg-config --libs opencv
That's all folks!
-
wrote on 25 Jun 2014, 13:43 last edited by
[quote author="me.javier@gmail.com" date="1403091317"]hi again,
I solve the problem!
- complete remove opencv and qt
- Install opncv and qt following "this":https://code.google.com/p/qt-opencv-multithreaded/wiki/Documentation instrucions
- in your .PRO file put simply
LIBS +=pkg-config --libs opencv
That's all folks![/quote]
Thanks for the reply. I was using netbeans to work with qt and opencv. You helped a lot.
-
Hi,
For 3)
@
CONFIG += link_pkgconfig
PKGCONFIG += opencv
@