devd251993
13th February 2014, 10:50
Hi,
I am trying to run simple program of Opencv for opening camera.
But after compiling i am getting linking error
:-1: error: LNK1104: cannot open file 'G:\Opencv-2.4.5\Opencv\build\x86\libs.obj'
I have checked libs folder but there is no libs.obj file present there
This my .pro file
#-------------------------------------------------
#
# Project created by QtCreator 2014-02-13T12:51:19
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Project
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
INCLUDEPATH += G:\\Opencv-2.4.5\\Opencv\\build\\include
LIBS +=G:\\Opencv-2.4.5\\Opencv\\build\\x86\\libs \
-lopencv_calib3d245 \
-lopencv_calib3d245d \
-lopencv_contrib245 \
-lopencv_contrib245d \
-lopencv_core245 \
-lopencv_core245d \
-lopencv_features2d245 \
-lopencv_features2d245d \
-lopencv_gpu245 \
-lopencv_gpu245d \
-lopencv_highgui245 \
-lopencv_highgui245d \
-lopencv_imgproc245 \
-lopencv_imgproc245d \
-lopencv_video245 \
-lopencv_video245d
This is the code I have written
#include "mainwindow.h"
#include <QApplication>
#include <opencv/cv.h>
#include <opencv/highgui.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
CvCapture *capture = 0;
IplImage *frame = 0;
int key = 0;
/* initialize camera */
capture = cvCaptureFromCAM( 0 );
/* always check */
if ( !capture ) {
fprintf( stderr, "Cannot open initialize webcam!\n" );
return 1; }
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 640);
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, 480);
cvSetCaptureProperty(capture, CV_CAP_PROP_FPS, 8);
/* create a window for the video */
cvNamedWindow( "result", CV_WINDOW_AUTOSIZE );
while( key != 'q' ) {
/* get a frame */
frame = cvQueryFrame( capture );
/* always check */
if( !frame ) break;
/* display current frame */
cvShowImage("Left", frame);
/* exit if user press 'q' */
key = cvWaitKey( 1 ); }
/* free memory */
cvDestroyWindow( "result" );
cvReleaseCapture( &capture );
return a.exec();
}
Snapshot of error
10042
Can anybody help me please?
I am trying to run simple program of Opencv for opening camera.
But after compiling i am getting linking error
:-1: error: LNK1104: cannot open file 'G:\Opencv-2.4.5\Opencv\build\x86\libs.obj'
I have checked libs folder but there is no libs.obj file present there
This my .pro file
#-------------------------------------------------
#
# Project created by QtCreator 2014-02-13T12:51:19
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Project
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
INCLUDEPATH += G:\\Opencv-2.4.5\\Opencv\\build\\include
LIBS +=G:\\Opencv-2.4.5\\Opencv\\build\\x86\\libs \
-lopencv_calib3d245 \
-lopencv_calib3d245d \
-lopencv_contrib245 \
-lopencv_contrib245d \
-lopencv_core245 \
-lopencv_core245d \
-lopencv_features2d245 \
-lopencv_features2d245d \
-lopencv_gpu245 \
-lopencv_gpu245d \
-lopencv_highgui245 \
-lopencv_highgui245d \
-lopencv_imgproc245 \
-lopencv_imgproc245d \
-lopencv_video245 \
-lopencv_video245d
This is the code I have written
#include "mainwindow.h"
#include <QApplication>
#include <opencv/cv.h>
#include <opencv/highgui.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
CvCapture *capture = 0;
IplImage *frame = 0;
int key = 0;
/* initialize camera */
capture = cvCaptureFromCAM( 0 );
/* always check */
if ( !capture ) {
fprintf( stderr, "Cannot open initialize webcam!\n" );
return 1; }
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 640);
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, 480);
cvSetCaptureProperty(capture, CV_CAP_PROP_FPS, 8);
/* create a window for the video */
cvNamedWindow( "result", CV_WINDOW_AUTOSIZE );
while( key != 'q' ) {
/* get a frame */
frame = cvQueryFrame( capture );
/* always check */
if( !frame ) break;
/* display current frame */
cvShowImage("Left", frame);
/* exit if user press 'q' */
key = cvWaitKey( 1 ); }
/* free memory */
cvDestroyWindow( "result" );
cvReleaseCapture( &capture );
return a.exec();
}
Snapshot of error
10042
Can anybody help me please?