Depends tools and DUMPBIN tools use

Source: Internet
Author: User

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

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.