Problems with Opencv 2.3.1

i have a problem:

I'm using VS Express 2010 and trying to add opencv library to my project, so i already added bin-files to my path, then added lib to properties of my project and 2 Include Directories

this is text of my program:

#include <cv.h>
#include <highgui.h>
#include <stdio.h>

int main(int argc, char* argv[])
{
    IplImage* img=0;
    img = cvLoadImage (argv[1], CV_LOAD_IMAGE_COLOR);
}

and i have an error: Error 1 error LNK2019: unresolved external symbol _cvLoadImage referenced in function _main c:UsersHomedocumentsvisual studio 2010Projectsexample2example2ex2.obj

what did i do wrong? thanks everybody


Make sure that you're properly linking to the OpenCV libraries. Since cvLoadImage is part of the HighGUI library within OpenCV, make sure you link to opencv_highui231.lib (in release) and opencv_highguid231.lib (in debug).

To do this in Visual Studio 2010, right-click on your project, then go to Linker->Input and type the name of the library you wish to link to inside Additional Dependencies. Also make sure that the path is accessible, either by typing the relative path into the Additional Dependencies field or by setting Additional Library Directories inside Linker->General.

链接地址: http://www.djcxy.com/p/65866.html

上一篇: 如何生成cvblob.lib?

下一篇: Opencv 2.3.1的问题