Knowledge.ToString()

C/C++ Dll: Two Ways to Get a List of Exported Symbols on Windows

If you are developing a C/C++ dll, you want to make sure that you are exporting the symbols.

Exporting symbols will help you use your dll using PInvoke by exposing only needed interface while hiding the implementation within C/C++ code.

You will get plenty of online resources when you are using Linux for your development. But if you are a an occasional C/C++ developer on Windows, it is a bit time consuming to get needed details online.

Two Ways to Get a List of Exported Symbols

There are two ways to get a list of exported symbols from your C/C++ dll.

1. Use Visual Studio Command Prompt

For Visual Studio 2022, you need to go to Tools menu > Command Line > Developer Command Prompt.

Visual Studio 2022 menu location for Developer Command Prompt

Once the command prompt is open, navigate to the folder which contains your dll.

Execute following command to show a list of exported symbols.

dumpbin /exports AwesomeSoftware.dll

The command output will show you a list of exported symbols.

Visual Studio Dumpbin exported symbol sample

2. Use Dependency Walker Program

You may download Dependency Walker.

Once you extract zip file, open “depends.exe”.

Go to File menu > Open… and select your dll.

It may take some time (1-3 minutes) to open your dll so don’t give up. Once the Dependency Walker completes its analyses, you will get a list of your exported symbols.

Location of exported symbols in Dependency Walker program

Share

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *