我正在尝试使用带有 opencv 的简单 c++ 代码:
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <iostream>
using namespace std;
int main ( int argc, char **argv )
{
cvNamedWindow( "My Window", 1 );
IplImage *img = cvCreateImage( cvSize( 640, 480 ), IPL_DEPTH_8U, 1 );
CvFont font;
double hScale = 1.0;
double vScale = 1.0;
int lineWidth = 1;
cvInitFont( &font, CV_FONT_HERSHEY_SIMPLEX | CV_FONT_ITALIC,
hScale, vScale, 0, lineWidth );
cvPutText( img, "Hello World!", cvPoint( 200, 400 ), &font,
cvScalar( 255, 255, 0 ) );
cvShowImage( "My Window", img );
cvWaitKey();
cout << "hello world";
return 0;
}
我已经包含在properties-->c/c++ build-->setting-->Cygwin c++ compiler-->Includes the absolute path of my opencv/build/include 下,并在Cygwin c++ linker-->libraries下包含路径和这次库(opencv_core246,opencv_highgui246)使用unix风格的路径/cygdrive/c/...(我读到有人建议这样做)。我收到此错误:“make:多个目标模式。停止。” 我知道这个问题与路径中的make和多个冒号有关......我在 Windows 7 (x64)、cygwin 和 Eclipse 上。谁能帮我?谢谢