Ask Your Question
1

need help debug with no error, but error on release

asked 2012-12-14 02:01:35 -0500

budong gravatar image

updated 2012-12-14 03:19:55 -0500

Andrey Pavlenko gravatar image

Hi all, i am need to openCV and i need some guidance.

I am on the path of learning through online youtubing, when i build the file in debugging, there is no error, but when i tried to build it in release, there is error.

The Error:

1>C:\opencv243\include\opencv\cv.h(63): fatal error C1083: Cannot open include file: 'opencv2/core/core_c.h': No such file or directory
1>
1>Build FAILED.

Program:

#include <C:\opencv243\include\opencv\cv.h>
#include <C:\opencv243\include\opencv\highgui.h>

using namespace cv;

int main()
{
    //create Matrix to store image
    Mat image;
    // initialize capture
    VideoCapture cap;
    cap.open(0);
    // create window to show image namedWindow(“window”, CV_WINDOW_AUTOSIZE);
    namedWindow("window",1);
    while(1)
    {    
        // copy webcam stream to image
        cap>>image;
        // print image to screen imshow(“window”, image);
        imshow("window",image);
        // delay 33ms waitKey(33);
        waitKey(33);    
    }
    return 0; 
}

Thank you very much if you can help me. I need to finish this for my final year project and till this period, i am still in a mist. i have tried Ubuntu but i have no luck in it, so i jump visual studio as i am more familiar in this platform.

edit retag flag offensive close merge delete

Comments

I have solve the problem, i have to individual .h and .hpp file to chance the include part for example #include <D:\opencv\include\opencv\highgui.h>

but and again, i got another error :/

1>main.obj : error LNK2001: unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?namedWindow@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) 1>main.obj : error LNK2001: unresolved external symbol "int __cdecl cv::waitKey(int)" (?waitKey@cv@@YAHH@Z) 1>main.obj : error LNK2001: unresolved external symbol "public: __cdecl cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray@cv@@QEAA@AEBVMat@1@@Z) 1>main.obj : error LNK2001: unresolved external symbol "

budong gravatar imagebudong ( 2012-12-14 08:07:17 -0500 )edit

C:\Users\Steven\Documents\Visual Studio 2010\Projects\mynewproject\x64\Release\mynewproject.exe : fatal error LNK1120: 10 unresolved externals

budong gravatar imagebudong ( 2012-12-14 08:07:53 -0500 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2012-12-14 02:25:11 -0500

Look at the libraries you have included inside your project settings. At the linker tab --> Input you have probably linked to openCV libraries like for example opencv_highgui243d.lib.

Notice the small d indicating these libraries are compiled explicitly for debugging purposes. If you want to go to execution, i guess you are trying to build in release mode. This mode however needs the proper libraries included, being for our example opencv_highgui243.lib without the small d.

Some helpfull links on configuring project settings: (however this is version 2.2 but the idea stays the same) http://opencv.willowgarage.com/wiki/VisualC%2B%2B

edit flag offensive delete link more

Comments

1

HI steven, i thought was that problem, but how ever, i tried changing all the libraries, still the same

For vcc++ directories Library Directories, i added $(OPENCV_BUILD)\x64\vc10\lib

For C/C++ Additional Include Directories , i added $(OPENCV_BUILD)\include; $(OPENCV_BUILD)\include\opencv; $(OPENCV_BUILD)\include\opencv2;

For linker Additional Dependencies, i added opencv_core243.lib opencv_imgproc243.lib opencv_highgui243.lib opencv_ml243.lib opencv_video243.lib opencv_features2d243.lib opencv_calib3d243.lib opencv_objdetect243.lib opencv_contrib243.lib opencv_legacy243.lib opencv_flann243.lib

Additional Library Directories, i added, $(OPENCV_BUILD)\x64\vc10\lib;

Thanks for getting to me, really appreciate

budong gravatar imagebudong ( 2012-12-14 03:28:56 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-12-14 02:01:35 -0500

Seen: 2,778 times

Last updated: Dec 14 '12