Change error message when linking fails #1709

hanst99 opened this Issue Mar 1, 2014 · 0 comments


None yet
4 participants

hanst99 commented Mar 1, 2014

I just lost half a day of work because the error message for linker failures is extremely misleading:

cabal: Missing dependency on a foreign library:
* Missing C library: chipmunk
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.

This suggests that the library isn't there, or at least not on cabals library search path. I had to turn on -v3 to find out that the problem wasn't that the library couldn't be found, but that it requires libm which wasn't linked to.

/usr/local/lib/ undefined reference to `__pow_finite'
/usr/local/lib/ undefined reference to `sincos'
/usr/local/lib/ undefined reference to `__exp_finite'
/usr/local/lib/ undefined reference to `sin'
/usr/local/lib/ undefined reference to `__acos_finite'

I suggest that upon failure to link the real error message (in this case, the one from gcc - I don't know what's being used on windows or osx) should always be reported. In any case, an error message shouldn't give a wrong impression of what the actual point of failure is if it can be helped at all.

@ttuegel ttuegel added this to the Cabal-1.24 milestone Apr 23, 2015

@23Skidoo 23Skidoo modified the milestones: Cabal 1.24, Cabal 1.26 Feb 21, 2016

@ezyang ezyang modified the milestone: Cabal 2.0 Sep 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment