在其他系统中执行.exe控制台的问题 [英] issue with execute .exe console in other system

查看:50
本文介绍了在其他系统中执行.exe控制台的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在c ++ visual studio 2015中编写简单的程序,它依赖于几个外部库,如`Opencv`和`Caffe`,这是我的代码:



i write simple program in c++ visual studio 2015 that depend several external library like `Opencv` and `Caffe` this is my code :

    #include "vaisLib.h"
    #include "opencv2\opencv.hpp"
    void main(){
    std::cout << "began Program \n";
    vaisLib::Functions::init();
    std::string path;
    std::cout << "enter path : \n";
    std::cin >> path;
    cv::Mat img = cv::imread(path);
    std::cout << "Result Id : " << vaisLib::Functions::Classify(img);
    getchar();
    }






这段代码在我的电脑上成功构建并运行,但是当复制这个带有所有`DLL`依赖项的程序时另一台PC或虚拟机的`.exe`运行,但只是黑色控制台和注意发生!没有错误和例外只是黑色控制台!!另外我的windows
是10,目标窗口是7.
$
i尝试使用`x64dbg`调试`exe`文件,发现它陷入了这个循环:
$




this code successfully build and run in my PC, but when copy this program with all `DLL` dependencies to another PC or virtual machine's `.exe` run but just black console and noting occur!! no error and exception just black console !!In addition my windows is 10 and destination windows is 7.
i try debug `exe` file with `x64dbg` and found it trap into the this loop :

    0000000077AC6139        | 48 8D 94 24 88 00 00 00            | lea rdx,qword ptr ss:[rsp+88]                           |
    0000000077AC6141        | 33 C9                              | xor ecx,ecx                     
                        |
    0000000077AC6143        | E8 A8 B4 00 00                     | call <ntdll.ZwDelayExecution>                   
        |
    0000000077AC6148        | 89 44 24 30                        | mov dword ptr ss:[rsp+30],eax                   
        |
    0000000077AC614C        | 85 C0                              | test eax,eax                     
                       |
    0000000077AC614E        | 0F 88 2B 73 03 00                  | js ntdll.77AFD47F                           
            |
    0000000077AC6154        | 44 39 35 C1 BE 0E 00               | cmp dword ptr ds:[77BB201C],r14d                        |
    0000000077AC615B        | 74 DC                              | je ntdll.77AC6139 


我的程序包含所有DLL和依赖项:

my program with all DLL's and dependencies:

    boost_chrono-vc120-mt-1_61.dll 
    boost_filesystem-vc120-mt-1_61.dll 
    boost_python-vc120-mt-1_61.dll 
    boost_system-vc120-mt-1_61.dll 
    boost_thread-vc120-mt-1_61.dll 
    gflags.dll 
    glog.dll 
    libgcc_s_seh-1.dll 
    libgfortran-3.dll 
    libopenblas.dll 
    libquadmath-0.dll 
    libwinpthread-1.dll 
    LLDeploy.prototxt 
    LLvais3.dat 
    LL_Net2_iter_5000.dat 
    LL_Net2_iter_5000_0.95.caffemodel 
    ntdll.dll 
    opencv_ffmpeg320_64.dll 
    opencv_world320.dll 
    python27.dll 
    vaisdll.dll 
    vaistest.exe


如何解决这个问题?为什么会出现这个问题?
b
$
谢谢。




how can fixed this issue? and why this issue occur?

thanks.


推荐答案

嗨Aligolos,

Hi Aligolos,

感谢您在此发布。

>>此代码在我的电脑上成功构建并运行,但是当把这个程序与所有`DLL`依赖项复制到另一台PC或虚拟机的`.exe`运行但只是黑色控制台和注意发生!!没有错误和例外只是黑色控制台!!另外
我的窗口是10,目标窗口是7。

哪个版本的Windows SDK和平台工具集做您使用?

Which version of the Windows SDK and platform toolset do you use?

您是否尝试安装相同版本的Windows SDK和vc ++可再发行组件包,请再试一次?

Have you tried to install the same version of Windows SDK and vc++ redistributable package, the try again?

您可以使用依赖性walker 来检查你实际使用的DLL。然后按照以下这些文档分发c ++文件。

You could use dependency walker to check which DLLs do you actually use. Then follow these documents below to distribute c++ files.

https://msdn.microsoft.com/en-us/library/ms235299.aspx?f=255&MSPPError=-2147217396

https://msdn.microsoft.com/en-us/library/8kche8ah.aspx

希望这可以帮到你。

此外,本论坛是关于使用Microsoft产品进行c ++开发的。如果您的问题与第三方库更相关,请在自己的论坛上发帖以获得更好的支持。例如:
Open CV forum

Besides, this forum is about c++ development with Microsoft products. If your problem is more related to third-party libraries, please post on their own forum for better support. For example: Open CV forum.

您的理解与合作将不胜感激。

Your understanding and cooperation will be grateful.

最诚挚的问候,

Sera Yu


这篇关于在其他系统中执行.exe控制台的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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