gpt4 book ai didi

c - Labwindows 无法编译 - 表示缺少项目中已有的 dll

转载 作者:行者123 更新时间:2023-11-30 17:43:22 26 4
gpt4 key购买 nike

我正在尝试将 openCV 与 LabWindows 2012SP1 一起使用。我有一个简单的项目,试图在 Debug模式下运行一个简单的“Hello World”程序。

我尝试运行的代码是

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

// Create a window to show the image
cvNamedWindow( "My Cool Window", CV_WINDOW_AUTOSIZE );
IplImage *img = cvCreateImage( cvSize( 300, 100 ), IPL_DEPTH_8U, 3 );

double hScale = 1.0;
double vScale = 1.0;
double shear = 0.0;
int lineWidth = 2;

// Initialize the font
CvFont font;
cvInitFont( &font, CV_FONT_HERSHEY_SCRIPT_COMPLEX, hScale, vScale, shear, lineWidth, 8 );

// Write on the image ...
CvScalar color = CV_RGB( 0, 51, 102 );
cvPutText( img, "Hello World!", cvPoint( 60, 60 ), &font, color );

// ... and show it to the world !
cvShowImage( "My Cool Window", img );

// Wait until the user wants to exit
cvWaitKey(0);

我添加了以下库:

opencv_core247d.lib (32-bit)

opencv_highgui247d.lib (32-bit)

opencv_imgproc247d.lib (32-bit)

opencv_imgproc247d.dll

但是,当我在 Debug模式下运行程序时,我收到一条错误消息:

The program can't start because opencv_imgproc247d.dll is missingfrom your computer. Try reinstalling the program to fix this problem.

此时我有点困惑,因为我已将相关 DLL 添加到项目中。

帮忙?

最佳答案

  • 您需要将 opencv dll 的位置添加到“PATH”环境变量中。
  • 不要使用旧的 c-api(不久的将来将不再受支持)(IplImages、cv* 函数)。请改用 cv::Mat 和 c++ api(命名空间 cv)。

关于c - Labwindows 无法编译 - 表示缺少项目中已有的 dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20248795/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com