Skip to content

Build fails on windows. #1

@AndreasPK

Description

@AndreasPK

It seems the generated DLL tries to export more symbols than supported which causes the build to fail.

[1 of 1] Compiling Export           ( foreign-src\Export.hs, C:\ghc\msys64\home\andi\tmp\phash\dist-newstyle\build\x86_64-windows\ghc-8.10.4\perceptual-hash-0.1.4.0\f\hsphash\build\hsphash\hsphash-tmp\Export.o )
[1 of 4] Compiling Parallel         ( app\Parallel.hs, C:\ghc\msys64\home\andi\tmp\phash\dist-newstyle\build\x86_64-windows\ghc-8.10.4\perceptual-hash-0.1.4.0\x\phash\build\phash\phash-tmp\Parallel.o )
[2 of 4] Compiling Paths_perceptual_hash ( C:\ghc\msys64\home\andi\tmp\phash\dist-newstyle\build\x86_64-windows\ghc-8.10.4\perceptual-hash-0.1.4.0\x\phash\build\phash\autogen\Paths_perceptual_hash.hs, C:\ghc\msys64\home\andi\tmp\phash\dist-newstyle\build\x86_64-windows\ghc-8.10.4\perceptual-hash-0.1.4.0\x\phash\build\phash\phash-tmp\Paths_perceptual_hash.o )
[3 of 4] Compiling Parser           ( app\Parser.hs, C:\ghc\msys64\home\andi\tmp\phash\dist-newstyle\build\x86_64-windows\ghc-8.10.4\perceptual-hash-0.1.4.0\x\phash\build\phash\phash-tmp\Parser.o )

app\Parser.hs:3:1: warning: [-Wunused-imports]
    The import of ‘Data.Semigroup’ is redundant
      except perhaps to import instances from ‘Data.Semigroup’
    To import instances alone, use: import Data.Semigroup()
  |
3 | import           Data.Semigroup        ((<>))
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[4 of 4] Compiling Main             ( app\Main.hs, C:\ghc\msys64\home\andi\tmp\phash\dist-newstyle\build\x86_64-windows\ghc-8.10.4\perceptual-hash-0.1.4.0\x\phash\build\phash\phash-tmp\Main.o )
Linking C:\ghc\msys64\home\andi\tmp\phash\dist-newstyle\build\x86_64-windows\ghc-8.10.4\perceptual-hash-0.1.4.0\x\phash\build\phash\phash.exe ...
[1 of 1] Compiling Export           ( foreign-src\Export.hs, C:\ghc\msys64\home\andi\tmp\phash\dist-newstyle\build\x86_64-windows\ghc-8.10.4\perceptual-hash-0.1.4.0\f\hsphash\build\hsphash\hsphash-tmp\Export.o ) [flags changed]
Linking C:\ghc\msys64\home\andi\tmp\phash\dist-newstyle\build\x86_64-windows\ghc-8.10.4\perceptual-hash-0.1.4.0\f\hsphash\build\hsphash\hsphash.dll ...
C://ghc//msys64//opt//ghc-8.10.4//mingw//bin/ld.exe: error: export ordinal too large: 103173
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)
cabal.exe: Failed to build flib:hsphash from perceptual-hash-0.1.4.0.

I assume not all entry points to the DLL are needed, in which case the use of a .def file can avoid this. See also https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/win32-dlls.html#building-and-using-win32-dlls

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions