Ask Your Question
0

an error when debugging

asked 2015-04-15 02:13:06 -0600

updated 2017-08-23 16:42:21 -0600

Hello masters, i a new comer here,

i got a problem when debugging my first program, my computer said "1>c:\users\user\documents\visual studio 2010\projects\open_cv_test1\open_cv_test1\main.cpp(10): error C2065: 'C' : undeclared identifier"

what is the mean? and what should i do?

thanks

edit retag flag offensive close merge delete

Comments

please add your code, we can't help without it.

berak gravatar imageberak ( 2015-04-15 02:14:41 -0600 )edit


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


    using namespace cv;
    int C;

    int main(){

        IplImage* img= cvLoadImage(C:\Users\user\Pictures\fatchur.jpg);
        cvNamedWindow( "example1", CV_WINDOW_NORMAL );
        cvShowImage ( "example1", img );
        cvWaitKey(0);
        cvReleaseImage(&img);
        cvDestroyWindow("example1");
        return 0;
    }
Fatchur gravatar imageFatchur ( 2015-04-15 02:33:36 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-04-15 02:36:51 -0600

berak gravatar image

updated 2015-04-15 03:45:13 -0600

Fatchur, please do not use opencv's legacy c-api, if it has IplImages in it, - run away !

#include <opencv2/opencv.hpp> // c++ headers(opencv2)
using namespace cv;

int main(){
    // single backslashes in path, please.
    Mat img = imread("C:/Users/user/Pictures/fatchur.jpg"); // path wrapped with "" !
    namedWindow( "example1", CV_WINDOW_NORMAL );
    imshow( "example1", img );
    waitKey(0);
    return 0; // no manual release nessecary.
}
edit flag offensive delete link more

Comments

There are some an error master 1>------ Build started: Project: OPEN_CV_TEST1, Configuration: Debug Win32 ------ 1> main.cpp 1>C:\Program Files\opencv\build\x64\vc10\bin\opencv_calib3d2411d.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x320 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Fatchur gravatar imageFatchur ( 2015-04-15 05:43:20 -0600 )edit

Master, my computer is 64bit, and the configuration of debug is win32, is it has an effect?

Fatchur gravatar imageFatchur ( 2015-04-15 05:44:47 -0600 )edit

if your configuration is 32bit, you have to link against the libs from the x86 folder

berak gravatar imageberak ( 2015-04-15 05:53:59 -0600 )edit

how to do that?

i'm sorry, i'm really newbe

Fatchur gravatar imageFatchur ( 2015-04-15 06:18:16 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-04-15 02:13:06 -0600

Seen: 671 times

Last updated: Apr 15 '15

Related questions