christian-marie / phone-numbers

Incomplete bindings to libphonenumber for Haskell
Other
7 stars 7 forks source link

extra-libraries should include protobuf #5

Closed enolan closed 7 years ago

enolan commented 7 years ago

On my machine (Ubuntu 17.04), running stack test gives the following error:

Linking .stack-work/dist/x86_64-linux-nopie/Cabal-1.22.5.0/build/test/test ...
/usr/bin/ld: /home/enolan/mystuff/code/signalvine/phone-numbers/.stack-work/dist/x86_64-linux-nopie/Cabal-1.22.5.0/build/libHSphone-numbers-0.1.0-FpN97xjzh610CIp2EYQ62a.a(phone-numbers.o): undefined reference to symbol '_ZN6google8protobuf8internal13empty_string_B5cxx11E'
//usr/lib/x86_64-linux-gnu/libprotobuf.so.10: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Progress: 1/2
--  While building package phone-numbers-0.1.0 using:
      /home/enolan/.stack/setup-exe-cache/x86_64-linux-nopie/Cabal-simple_mPHDZzAJ_1.22.5.0_ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux-nopie/Cabal-1.22.5.0 build lib:phone-numbers test:test --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

Adding protobuf to the extra-libraries field in phone-numbers.cabal fixes it. I'm clueless as to why it works on other people's machines, it shouldn't be able to link protobuf without being told to do so. I can PR the one-line change, it should be harmless for people for whom it's working already, but I thought I'd hold off since I don't fully understand the situation.

christian-marie commented 7 years ago

Thanks. That sounds right. It should probably have protobuf in extra-libraries.

christian-marie commented 7 years ago

7 closes