lpsmith / postgresql-libpq

Low-level Haskell bindings for libpq
BSD 3-Clause "New" or "Revised" License
19 stars 18 forks source link

"error: ‘PGRES_SINGLE_TUPLE’ undeclared" while building #34

Closed richsmith92 closed 8 years ago

richsmith92 commented 8 years ago

I'm on Debian, using 9.1.23-0+deb7u1 version of libpq-dev. Can't install postgresql-libpq as a dependency using stack:

--  While building package postgresql-libpq-0.9.2.0 using:
      /data/fast/tmp/stack15900/postgresql-libpq-0.9.2.0/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.0.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /data/fast/akarakulov/toolset/.stack-work/logs/postgresql-libpq-0.9.2.0.log

    [1 of 1] Compiling Main             ( /data/fast/tmp/stack15900/postgresql-libpq-0.9.2.0/Setup.hs, /data/fast/tmp/stack15900/postgresql-libpq-0.9.2.0/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup/Main.o )
    Linking /data/fast/tmp/stack15900/postgresql-libpq-0.9.2.0/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup/setup ...
    Configuring postgresql-libpq-0.9.2.0...
    Building postgresql-libpq-0.9.2.0...
    Preprocessing library postgresql-libpq-0.9.2.0...
    LibPQ.hsc:1916:0: warning: "hsc_alignment" redefined [enabled by default]
    In file included from .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Database/PostgreSQL/LibPQ_hsc_make.c:1:0:
    /data/fast/akarakulov/.stack/programs/x86_64-linux/ghc-8.0.1/lib/ghc-8.0.1/template-hsc.h:88:0: note: this is the location of the previous definition
    LibPQ.hsc: In function ‘main’:
    LibPQ.hsc:983:5: error: ‘PGRES_SINGLE_TUPLE’ undeclared (first use in this function)
    LibPQ.hsc:983:5: note: each undeclared identifier is reported only once for each function it appears in
    compiling .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Database/PostgreSQL/LibPQ_hsc_make.c failed (exit code 1)
    command was: /usr/bin/gcc -c .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Database/PostgreSQL/LibPQ_hsc_make.c -o .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Database/PostgreSQL/LibPQ_hsc_make.o -fno-stack-protector -fno-stack-protector -D__GLASGOW_HASKELL__=800 -Dlinux_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dlinux_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -I/usr/include/postgresql -Icbits -I.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/autogen -include .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/autogen/cabal_macros.h -I/data/fast/akarakulov/.stack/programs/x86_64-linux/ghc-8.0.1/lib/ghc-8.0.1/bytestring-0.10.8.1/include -I/data/fast/akarakulov/.stack/programs/x86_64-linux/ghc-8.0.1/lib/ghc-8.0.1/base-4.9.0.0/include -I/data/fast/akarakulov/.stack/programs/x86_64-linux/ghc-8.0.1/lib/ghc-8.0.1/integer-gmp-1.0.0.1/include -I/data/fast/akarakulov/.stack/programs/x86_64-linux/ghc-8.0.1/lib/ghc-8.0.1/include -I/data/fast/akarakulov/.stack/programs/x86_64-linux/ghc-8.0.1/lib/ghc-8.0.1/include/
lpsmith commented 8 years ago

You need to either use postgresql-libpq version 0.9.1.1, or upgrade libpq to 9.2.

It's unintentional that the version numbers line up like that, and sadly, that's unlikely to last.

richsmith92 commented 8 years ago

Great! Thanks for the fast reply.