GHC on windows does not resolve DLL dependencies
GHC does not correctly tell the Windows Loader how to handle dependencies to dll's that are not on the standard windows load path:
- The directory from which the application loaded.
- The current directory.
- The system directory. Use the
GetSystemDirectoryfunction to get the path of this directory. - The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
- The Windows directory. Use the
GetWindowsDirectoryfunction to get the path of this directory. - The directories that are listed in the
PATHenvironment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.
So what this means is given two DLLs A and B and B depending on A. If we put both DLLs into a new folder bin and then call GHC with:
ghc -L$(PWD)/bin -lB
the loading will fail as the Windows loader will try to load the dependency of B and fail since it cannot find A.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.10.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Runtime System (Linker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |