Application run smoothly in the IDE debug environment of VS, but run EXE error in bin directory directly

Source: Internet
Author: User
In the project you need to get real-time video of the camera, because you do not want to install third-party installation files to implement, filtered to find the Libeasyplayer in Easydarwin. Our project language is C#,libeasyplayer language is C + +, in the IDE debugging environment through the DllImport method directly call Libeasyplayer is successful, the video display smoothly. But in this machine directly run EXE unexpectedly error. Online search information, the solution is: 1, open cmd through the administrator to run the Netsh winsocket reset command. Result: no use. 2, DLL version of the problem through the VS comes with the dumpbin command to view the DLL version, that the existing version is 32-bit. To the official website to find a 64-bit DLL, replace it. EXE run or error, the error message is as follows: Have to find a friend for help, friends spend compiling platform reasons. The resulting platform was modified to x86, not any CPU. Choose the x86, compile run, directly double-click EXE run, everything normal! T_T finally solved it successfully. Summarize why the IDE will run normally, and EXE run error? A very good friend of the technology gave the conclusion that "the IDE and EXE referenced library file inconsistency caused by!" ”。 You didn't read it? Very normal, Daniel raised a chestnut: The exe executable file will refer to the corresponding DLL, such as LibEasyPlayer.dll here may refer to Kernel32.dll, Winmm.dll and so on. It is referenced in the following order: 1, in the execution of the file's current directory lookup. 2, find in the system directory, here is system32.3, the directory set in the environment variable to find. And the IDE is directly in its own debug directory to find the appropriate DLL, these versions of the DLL and the system directory version inconsistent, so the IDE to run without problems, and EXE directly to perform the error.

Application run smoothly in the IDE debug environment of VS, but run EXE error in bin directory directly

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.