System. dllnotfoundexception Problem Analysis and Solution

Source: Internet
Author: User
Tags vc runtime

Recently, I have been doing C ++ jobs and the interface is built with C #.ProgramThe core of the processing is the DLL written in native C ++. The whole program is compiled in vs2010. At first, we found that everything was running normally during the development and testing of the three computers, but when it was sent to others for running, when the interface of WPF calls the DLL written in C ++, the system will pop up. dllnotfoundexception error. I put the DLL in the directory of system32 and EXE and found that the problem persists.

A lot of Chinese websites do not seem to find a solution... later I saw it on a foreign website. The possible reasons for this are:

1. Whether the DLL function is correctly exported. This can be run on some computers, which indicates that the function has been correctly exported.

2. Whether the import method is correct.

[ dllimport ( " gdipluslibrary. DLL " , entrypoint = " imageeffects " )]

Public Static Extern Intptr Imageeffects ( Intptr Bitmap , Ref Parameter Param );

 

The export method is as above and can be run on the developer's computer, so the above issues are not considered.

3. Check whether the DLL depends on any other DLL.Code, No other DLL is called.

So where is the problem? Later, according to everyone's idea, I used depends to view the DLL Runtime Library and found that the DLL needed msvcr100.dll! I did not call it, nor did I select MFC. Why.

In this case, the computer running the DLL needs to install the VC 2010 Runtime library, and then re-compile the DLL with vs 2008, now, no error occurs on the computer that has installed the VC ++ 2008 Runtime Library.

Summary:

The incredible DLL cannot be loaded. Check whether the DLL requires other DLL. Although you have not called other DLL, it is not guaranteed that your compiler will secretly generate code to call other DLL. If the above problem occurs, you can try to install the VC Runtime Library and solve the problem!

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.