Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on windows. #1

Open
AndreasPK opened this issue Mar 15, 2021 · 0 comments
Open

Build fails on windows. #1

AndreasPK opened this issue Mar 15, 2021 · 0 comments

Comments

@AndreasPK
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant