30 Linking to DLLs on Windows

► |  | Inside: Racket C API

I | Inside Racket CS
II | Inside Racket BC (3m and CGC)
III | Appendices
| Index

▼ | III | Appendices

28 | Building Racket from Source
29 | Cross-compiling Racket Sources for i OS
30 | Linking to DLLs on Windows
31 | Embedding Files in Executable Sections

top contents ← prev up next →

## 30 Linking to DLLs on Windows🔗ℹ

Some Windows linking tools, such as MinGW-w64, accept a ".dll" for linking to generate an executable that refers to the ".dll". Other tools, such as Microsoft Visual Studio, need a ".lib" stub library to describe the ".dll" that will be used. The Racket distribution does not include ".lib" stub libraries, but various tools exist to generate a ".lib" file from a ".dll" and ".def" file that is included in a racket distribution.

To create a "x.lib" using Microsoft Visual Studio tools (to link with "x.dll"):

- Locate the file "x.def" using the same base name x as in "x.dll".

- Generate "x.lib" with this command:

  lib /def: x.def /out: x.lib /machine: mach

  Use a suitable platform description in place of mach, such as x64 for 64-bit Windows on x86_64.

top contents ← prev up next →