I'm trying to build a program in which I use gstreamer and opencv to manipulate images. This is my main file:
#include "GstSource.hpp"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/highgui/highgui_c.h>
#include <iostream>
static const int Key_Escape = 27;
int main(int argc, char *argv[])
{
cv::namedWindow("Gstreamer");
cvMoveWindow("Gstreamer",100,100);
GstreamerPlayer player;
if (! player.open("videotestsrc") )
std::cerr << "Unable to open pipeline" << std::endl;
if ( !player.setWidth(640) || !player.setHeight(480) ) {
std::cerr << "Unable to change resolution" << std::endl;
return 1;
}
bool fps_readed = false;
while (true) {
if (!player.grabFrame()) {
std::cerr << "Failed to grab frame" << std::endl;
break;
}
GstreamerImage * frame = player.getImage();
if (!frame) {
std::cerr << "Failed to retrieve frame" << std::endl;
break;
}
if (!fps_readed) {
std::cout << "Video playing at " << player.getFps() << " fps" < std::endl;
fps_readed = true;
}
cv::Mat canvas = cv::Mat(frame->height, frame->width, CV_8UC3, frame->data);
if ( canvas.empty() )
break;
cv::imshow("Gstreamer", canvas);
int key = cv::waitKey(10);
if (key == Key_Escape)
break;
}
}
and this is the .pro file:
QT += core
QT -= gui
TARGET = provaQT
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
INCLUDEPATH += /usr/include/gstreamer-1.0 \
/usr/local/include \
/usr/include/glib-2.0 \
/usr/lib/arm-linux-gnueabihf/glib-2.0/include \
/usr/lib/arm-linux-gnueabihf
LIBS += -L"/usr/lib/arm-linux-gnueabihf" -lglib-2.0 -lgobject-2.0 \
-L"/usr/local/lib" -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_videoio \
-L"/usr/lib/arm-linux-gnueabihf/gstreamer-1.0" -lgnl -lgst1394 -lgstaasink -lgstaccurip -lgstcoreelements \
-L"/home/odroid/Desktop/Gstreamer-Test/bin/linux/gst-plugins" -lgst-overlay
SOURCES += \
../Gstreamer-Test/src/gstinit.cpp \
../Gstreamer-Test/src/gstplugin.cpp \
../Gstreamer-Test/src/gstplugin_impl.cpp \
../Gstreamer-Test/src/GstSource.cpp \
../Gstreamer-Test/src/main.cpp \
../Gstreamer-Test/src/videotestoverlay.cpp
HEADERS += \
../Gstreamer-Test/src/gstplugin.hpp \
../Gstreamer-Test/src/gstplugin_impl.hpp \
../Gstreamer-Test/src/GstSource.hpp \
../Gstreamer-Test/src/videotestoverlay.hpp
and I get 147 error of this type: undefined reference to..... because many function used are declared but not defined. Where are their definition? How I can include their definition?