Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#7315 closed bug (fixed)

Link error while compiling executables

Reported by: bgamari Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo)

On GHC master (ef786b6cbc5f67a673bf8c10be5311317c1e7b88) attempting to build any executable results in a linker error. For instance, cabal install cmdargs results in,

     [37 of 37] Compiling Main             ( Main.hs, dist/build/cmdargs/cmdargs-tmp/Main.o )
     Linking dist/build/cmdargs/cmdargs ...
     /usr/bin/ld: cannot find -lHStransformers-0.3.0.0-ghc7.7.20121009
     collect2: error: ld returned 1 exit status
     cabal: Error: some packages failed to install:
     cmdargs-0.10 failed during the building phase. The exception was:
     ExitFailure 1

Yet transformers appears to be installed (although the version suffix doesn't appear to match),

     $ ls ~/.cabal/lib/transformers-0.3.0.0/ghc-7.7.20121009/
     Control  Data  HStransformers-0.3.0.0.o  libHStransformers-0.3.0.0.a  libHStransformers-0.3.0.0_p.a

Change History (3)

comment:1 Changed 19 months ago by igloo

  • Description modified (diff)
  • Difficulty set to Unknown

comment:2 Changed 19 months ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

Ah, your GHC defaults to using dynamic libraries, but the cabal you have doesn't know that, so it isn't building the dynamic library of the program's dependencies. If you use the --enable-shared flag to cabal then it should work. Alternatively, building cabal against the HEAD Cabal library should do so by default.

comment:3 Changed 19 months ago by bgamari

Indeed that did the trick. Thanks.

Note: See TracTickets for help on using tickets.