vc ++应用程序不能在其他计算机上运行 [英] vc++ application don't run on other computer

查看:127
本文介绍了vc ++应用程序不能在其他计算机上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,





我开发了一个vc ++应用程序,它有一个依赖文件,如5个.xml文件。



它在我的计算机上工作正常,当我在其他计算机上运行此.exe时,应用程序正在被攻击而不是重新编码并且给出错误无法找到路径无法访问5 .xml文件。



我应该对解决方案进行任何更改。我们可以解决这个问题的任何其他解决方案。



任何建议都将不胜感激。



全球声明xml文件是:



Hello,


I developed an vc++ application where it has a dependent files like 5 .xml files.

It is working fine in my computer where as when i run this .exe in other computer the application is getting struck and not respoding and giving error "unable to find the path" that is unable to access the 5 .xml files.

Should i make any changes in the solution. Any other solution where we can resolve this problem.

Any suggestions would be appreciated.

globally declared xml files are:

const char *faceCascadeFilename = "Haarcascade\\haarcascade_frontalface_alt2.xml";
const char *leftEyeCascadeFilename = "Haarcascade\\haarcascade_mcs_lefteye.xml";
const char *rightEyeCascadeFilename = "Haarcascade\\haarcascade_mcs_righteye.xml"  ;
const char *nose_cascade = "Haarcascade\\haarcascade_mcs_nose.xml";
const char *mouth_cascade = "Haarcascade\\haarcascade_mcs_mouth.xml";

BOOL CDlg::OnInitDialog() 
{
  EnrollFromCam(CString sString);
  return TRUE;
}

void EnrollFromCam(CString sString)
{
faceCascade     = ( CvHaarClassifierCascade *) cvLoad ( faceCascadeFilename,     0, 0, 0 )  ;

leftEyeCascade  = ( CvHaarClassifierCascade *) cvLoad ( leftEyeCascadeFilename,  0, 0, 0 )  ;

rightEyeCascade = ( CvHaarClassifierCascade *) cvLoad ( rightEyeCascadeFilename, 0, 0, 0 )  ;

cascade_nose    = ( CvHaarClassifierCascade *) cvLoad ( nose_cascade,            0, 0, 0 )  ;

cascade_mouth   = ( CvHaarClassifierCascade *) cvLoad ( mouth_cascade,           0, 0, 0 )  ;

if( !(faceCascade || leftEyeCascade ||cascade_nose||cascade_mouth || rightEyeCascade ) )
{
   MessageBox(NULL, L"ERROR in EnrollFromCam(): Could not load Haar cascade Face detection classifier in "%s".\n", L"Error", 0);
            return;
}
else
{
continue;
}



}

推荐答案

确保你有5.xml文件也复制到另一台计算机,也检查你如何获得你的应用程序中的文件路径。



您使用的是
Make sure that you have 5.xml files also copied to the other computer, also check how you get the File Path in your application.

Are you using
TCHAR pwd[MAX_PATH];
GetCurrentDirectory(MAX_PATH,pwd); 

获取文件路径?>



了解有关打开CV文件加载错误的更多信息



为了能够执行应用程序,您需要修改系统的PATH环境变量,以添加OpenCV的DLL的位置。将此添加到路径末尾:



opencv-2-3-c-visual-studio-2010 [ ^ ]

to get the File Path?>

Read More about Open CV File Load Error

To be able to execute the application you''ll need to modify the PATH environment variable of your system to add the location of OpenCV''s DLLs. Add this to end of PATH:

opencv-2-3-c-visual-studio-2010[^]


这篇关于vc ++应用程序不能在其他计算机上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆