When the system is deployed, we often find that a program can run on the development machine, but the deployment is not running on a PC, and there are some machines that can run for another machine but not run. The main manifestations are two phenomena:
(1), running, debugging, the program started the Times wrong, prompting an error could not start.
(2), the program executes the database query statement directly skip, query function calls when the breakpoint can not be interrupted. and no execution results.
In fact, the most important reason is that the program we deploy lacks some necessary runtime libraries (note the version of the library, the same library may appear if the version is inconsistent).
1.Depends
Depends is used to display dependencies (DLLs) associated with an executable file (EXE or DLL) and which interfaces in those DLLs are referenced by that EXE or DLL. You can also see all the exported function interfaces in each dependent DLL.
This tool obtains the DLL library that is implicitly connected to the viewer, that is, the DLL module associated with LIB, and cannot display the DLL module that is connected by the display, that is, the DLL function imported with the LoadLibrary function.
2.DUMPBINThe export functions are as follows:
1 //open_www.cpp: Defines the entry point of the console application. 2#include <stdio.h>3#include <stdlib.h>4 extern "C"_declspec (dllexport)intAddintAintb)5 {6 returnA +b;7 }8 intMainvoid)9 {Ten intC=0; OneC=add (1,4); Aprintf"c=%d\n", c); - return 0; -}
2.1 Open cmd2.2 Moving directories to C:\Program Files (x86) \microsoft Visual Studio\vc98\bin
(DUMPBIN. EXE directory)
2.3 Run command: VCVARS32. BAT
If you do not run Vcvars32.bat the following prompt will appear
2.4 You can call the Dumpbin.exe command below.
If you do not add extern "C" before exporting the function
/* extern "C" */_declspec (dllexport)int Add (int A,int b)
The result is shown as:
Depends tools and DUMPBIN tools use