Ask Your Question
1

Problems in running openCV in visual studio 2010 [closed]

asked 2014-09-05 05:43:38 -0600

jamesnzt gravatar image

updated 2014-09-06 03:33:43 -0600

I usually work in openCV in linux environment. when i installed opencv based on Stack Overflow. When i run a program a blank command window opens and no action. the following errors are displayed.

'jms.exe': Loaded 'C:\opencv\build\x86\vc10\bin\opencv_core249d.dll', Cannot find or open the PDB file
The thread 'Win32 Thread' (0x1a7c) has exited with code -1073741510 (0xc000013a).
The program '[2556] jms.exe: Native' has exited with code -1073741510 (0xc000013a).

What i have to do ? The program is

#include<opencv\highgui.h>
#include<iostream>

using namespace cv;
using namespace std;

int main()
{
    Mat im = imread("E:\10.jpg");
    if(!im.data)
    {
        cout<<"Image NOT FOUND "<<endl;
        return -1;
    }
    cout<<"Test"<<endl;
    namedWindow("Image",0);
    imshow("Image",im);
    waitKey(10);
}

while typing the code it displays the available header files and syntax of each function as hint.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by jamesnzt
close date 2015-02-11 03:54:47.088065

Comments

Are you getting any runtime error ? and is this cout display Test on that black screen ?

FLY gravatar imageFLY ( 2014-09-05 06:52:50 -0600 )edit

imread("E:\\10.jpg"); // 2 backslashes in paths, please

berak gravatar imageberak ( 2014-09-05 07:25:42 -0600 )edit
1

What @berak said or keep front slashes for Windows to avoid this issue. Also your issue is actually not due to this, the erro is not printed, rather a debug warning (which can be ignored here). Your problem is that you end with a waitKey(10) which states that you hold the application 10 millisec and then close everything down. Change it to waitKey(0) and you will see your window!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-09-05 07:40:09 -0600 )edit

I tried @StevenPuttemans but it no text is displayed and @berak a command window with a cursor blinking opens, then some symbols are loaded then command window closes.

jamesnzt gravatar imagejamesnzt ( 2014-09-05 11:07:30 -0600 )edit
1

Can you post that symbols ? if cout is not displaying text on command then just check cout before loop whether it work there or not

FLY gravatar imageFLY ( 2014-09-05 11:34:17 -0600 )edit

i edited the question with screen shot @FLY

jamesnzt gravatar imagejamesnzt ( 2014-09-05 11:55:42 -0600 )edit
1

sorry james, but that screenshot is not helpful at all

berak gravatar imageberak ( 2014-09-06 01:06:56 -0600 )edit
1

@jamesnzt just try cout after every line :) so you can know from where your getting error or whaeva

FLY gravatar imageFLY ( 2014-09-06 05:11:36 -0600 )edit

@FLY can you please suggest some links to install opencv with visual studio 2010.that works for you (my opencv 2.4.9 for windows, extracted file contains two folders 1. Build 2. sources)

jamesnzt gravatar imagejamesnzt ( 2014-09-08 01:31:57 -0600 )edit
1

james, also no worries, we're all getting pinged even without explicitly mentioning the names ;)

berak gravatar imageberak ( 2014-09-08 01:36:25 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
3

answered 2014-09-11 02:08:22 -0600

jamesnzt gravatar image

updated 2014-09-11 08:20:41 -0600

Finally i got the output.

I steps i missed in configuring VS2010 properties are

*c/C++ --> General ----> additional include directories *

c:\opencv\build\include
c:\opencv\build\include\opencv
c:\opencv\build\include\opencv2

*Linker ---> General----> addtional library dependencies *

c:\opencv\build\x64\vc10\lib

image description

image description

In release configuration add add dependencies

opencv_calib3d249.lib
opencv_contrib249.lib
opencv_core249.lib
opencv_features2d249.lib
opencv_flann249.lib
opencv_gpu249.lib
opencv_highgui249.lib
opencv_imgproc249.lib
opencv_legacy249.lib
opencv_ml249.lib
opencv_nonfree249.lib
opencv_objdetect249.lib
opencv_ocl249.lib
opencv_photo249.lib
opencv_stitching249.lib
opencv_superres249.lib
opencv_ts249.lib
opencv_video249.lib
opencv_videostab249.lib

image description

image description

Finally i specified the file an "E:\10.JPG"

image description

I got the output.

Thanks StevenPuttemans ,FLY ,berak

edit flag offensive delete link more

Comments

1

Edited your solution. Screencap was correct but you copied the linker option from the include. This is fixed now.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-09-11 08:21:36 -0600 )edit

If it is possible to build one big OpenCV library including everything, the step to add all the library names in the dependency option will be much simpler.

Do you happen to try that thing? If so, please share your experience.

openml gravatar imageopenml ( 2014-09-11 13:25:36 -0600 )edit

Nope that is not possible as far as I know. However in Visual Studio you can use property sheets and load those to each new project. By that you only need to configure it once correctly.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-09-11 14:20:16 -0600 )edit

is there any tutorial for creating a property sheet and to include it in various project?

jamesnzt gravatar imagejamesnzt ( 2014-09-12 00:07:42 -0600 )edit

This link has all the necessary information!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-09-12 01:55:36 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-09-05 05:43:38 -0600

Seen: 2,072 times

Last updated: Sep 11 '14