[Haskell-beginners] compiling a dynamic executable

Markus Läll markus.l2ll at gmail.com
Tue Mar 19 09:50:40 CET 2013


Hi!

I'm trying to compile a dynamic executable in Debian on a x86_64
architecture with ghc 7.4.1-4 and ghc-dynamic installed.

To compile the program I started from a clean cabal user database, set
the 'shared' and 'executable-dynamic' settings to 'True' in cabal conf
and fired away with 'cabal install' in my package's directory. It
compiled all the libraries fine-- both the static and dynamic --until
it reached compiling my own program, when in stopped with the
following error:

xxx.hs:1:1:
    Dynamic linking required, but this is a non-standard build (eg. prof).
    You need to build the program twice: once the normal way, and then
    in the desired way using -osuf to set the object file suffix.
/usr/bin/ghc returned ExitFailure 1

I don't have profiling enabled (or is it an example of non-standard
build?), but I also don't understand the proposed solution of building
the program twice.

Compiling with "ghc --make -dynamic {-X...}* Main.hs" ends with the
same error.. (I also know there is a multi-step manual way to do it,
so maybe it could pinpoint the problem -- but I haven't tried it yet)

What could be the problem?


-- 
Markus Läll



More information about the Beginners mailing list