← 返回命令列表

Linux command

dlltool 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create import library

dlltool -d [library.def] -l [library.a]

Create def file

dlltool -z [output.def] [library.dll]

Create DLL from

dlltool -d [library.def] -e [exports.o] [objects.o]

Specify machine type

dlltool -m [i386] -d [library.def] -l [library.a]

Create both import

dlltool -d [library.def] -l [library.a] -e [exports.o]

说明

dlltool is a GNU binutils tool for creating files needed to build and use Dynamic Link Libraries (DLLs) on Windows. It processes module definition (.def) files and creates import libraries and exports files. Import libraries allow linking against DLLs at compile time. The tool generates the necessary stubs that resolve at runtime. Export files define symbols that a DLL makes available to other programs. dlltool is essential for cross-compiling Windows software on Unix systems and for creating DLLs with MinGW and similar toolchains.

参数

-d, --input-def _FILE_
Read the named .def file.
-l, --output-lib _FILE_
Generate an import library.
-e, --output-exp _FILE_
Generate an exports file.
-z, --output-def _FILE_
Generate a .def file (from DLL or objects).
-y, --output-delaylib _FILE_
Create a delay-import library.
-m, --machine _MACHINE_
Target machine type (e.g. i386, x86_64, arm).
-D, --dllname _NAME_
Name of input DLL recorded in the library.
-U, --add-underscore
Prepend an underscore to all exported symbols.
-k, --kill-at
Strip @n suffix from stdcall exported names.
-A, --add-stdcall-alias
Add aliases for stdcall symbols without @n.
--export-all-symbols
Export all global and weak symbols.
-I, --identify _FILE_
Report DLL name associated with an import library.
-v, --verbose
Describe what is being done.
--help
Display help information.

FAQ

What is the dlltool command used for?

dlltool is a GNU binutils tool for creating files needed to build and use Dynamic Link Libraries (DLLs) on Windows. It processes module definition (.def) files and creates import libraries and exports files. Import libraries allow linking against DLLs at compile time. The tool generates the necessary stubs that resolve at runtime. Export files define symbols that a DLL makes available to other programs. dlltool is essential for cross-compiling Windows software on Unix systems and for creating DLLs with MinGW and similar toolchains.

How do I run a basic dlltool example?

Run `dlltool -d [library.def] -l [library.a]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -d, --input-def _FILE_ do in dlltool?

Read the named .def file.