Skip to content

linking on Windows #4

@akaposi

Description

@akaposi

When I tried to compile a Haskell package importing repa-devil on Windows it gave linking errors complaining about undefined references to IL functions such as:

 Linking dist\build\test\test.exe ...
 dist\build\shapes\test-tmp\Main.o:fake:(.text+0x71900): undefined reference to `ilInit'
 dist\build\shapes\test-tmp\Main.o:fake:(.text+0x71910): undefined reference to `ilOriginFunc'

I was able to fix it by replacing all foreign import ccall calling conventions by stdcall, eg.

 foreign import ccall unsafe "ilInit" ilInitC :: IO ()

by

 foreign import stdcall unsafe "ilInit" ilInitC :: IO ()

After reinstalling such a modified repa-devil I can read and write PNG images etc.

This is my setup:

A small Haskell program which triggers the error:

module Main where

import Data.Array.Repa.IO.DevIL

main = runIL $ do
  (RGB im) <- readImage "blah.png"
  return ()

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