9 Kasım 2010 Salı

fatal error LNK1104: cannot open file 'cv.lib' when using openCV2.1

When I compile this code I get an error: 
[error]
fatal error LNK1104: cannot open file 'cv.lib'
[/error]

In this situtation go to the
project -> *properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies

and add

"cv210d.lib" "cxcore210d.lib" "highgui210d.lib"

for debug option.


and add 

"cv210.lib" "cxcore210.lib" "highgui210.lib"

for release option.

[code]
// OpenCV_Helloworld.cpp : Defines the entry point for the console application.
// Created for build/install tutorial, Microsoft Visual C++ 2010 Express and OpenCV 2.1.0

#include "stdafx.h"

#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
        IplImage *img = cvLoadImage("C:\\work\\kn.jpg",1);
if(img == NULL)
{
cout << "error" << endl;
}
        cvNamedWindow("Image:",CV_WINDOW_AUTOSIZE );
        cvShowImage("Image:",img);

        cvWaitKey();
        cvDestroyWindow("Image:");
        cvReleaseImage(&img);

        return 0;
}
[/code]

Hiç yorum yok:

Yorum Gönder