<p>Im having problems building my projects using the the latest plutus apps:
commit 33c6e81ba4ab9cbb42870bbb6f916f8b4e2c7b3e (HEAD -&gt; main)</p>
<pre><code>Starting     postgresql-libpq-0.9.4.3 (all, legacy fallback)

Failed to build postgresql-libpq-0.9.4.3. The failure occurred during the
configure step.
Build log (
/home/manuelpadilla/.cabal/logs/ghc-8.10.7/postgresql-libpq-0.9.4.3-57a09a91f3e131b3474d6ed3933505829ef2226dbf9a3540a78fc56124386c83.log
):
[1 of 1] Compiling Main             ( /home/manuelpadilla/source/copyRepos/RATS-DAO/rats-dao-devs-staking-plutus-v2/dist-newstyle/tmp/src-4327/postgresql-libpq-0.9.4.3/dist/setup/setup.hs, /home/manuelpadilla/source/copyRepos/RATS-DAO/rats-dao-devs-staking-plutus-v2/dist-newstyle/tmp/src-4327/postgresql-libpq-0.9.4.3/dist/setup/Main.o )
Linking /home/manuelpadilla/source/copyRepos/RATS-DAO/rats-dao-devs-staking-plutus-v2/dist-newstyle/tmp/src-4327/postgresql-libpq-0.9.4.3/dist/setup/setup ...
Configuring postgresql-libpq-0.9.4.3...
setup: Missing dependency on a foreign library:
* Missing (or bad) C library: pq
This problem can usually be solved by installing the system package that
provides this library (you may need the &quot;-dev&quot; 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.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
</code></pre>
<p>I installed all the postgresql libraries I believe I needed.</p>
<p>I installed:</p>
<pre><code>&gt; apt-cache policy postgresql
&gt; postgresql:
      Installed: 15+244.pgdg20.04+1
      Candidate: 15+244.pgdg20.04+1
      Version table:
     *** 15+244.pgdg20.04+1 500
            500 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 Packages
            100 /var/lib/dpkg/status
         12+214ubuntu0.1 500
            500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
         12+214 500
            500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        
&gt; apt-cache policy libghc-postgresql-libpq-dev
&gt; libghc-postgresql-libpq-dev:
          Installed: 0.9.4.2-1build1
          Candidate: 0.9.4.2-1build1
          Version table:
         *** 0.9.4.2-1build1 500
                500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
                100 /var/lib/dpkg/status
    
&gt; apt-cache policy libpq5
&gt; libpq5:
      Installed: 15.0-1.pgdg20.04+1
      Candidate: 15.0-1.pgdg20.04+1
      Version table:
     *** 15.0-1.pgdg20.04+1 500
            500 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 Packages
            100 /var/lib/dpkg/status
         12.12-0ubuntu0.20.04.1 500
            500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
         12.2-4 500
            500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

&gt; apt-cache policy libpq-dev
&gt; libpq-dev:
      Installed: 15.0-1.pgdg20.04+1
      Candidate: 15.0-1.pgdg20.04+1
      Version table:
     *** 15.0-1.pgdg20.04+1 500
            500 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 Packages
            100 /var/lib/dpkg/status
         12.12-0ubuntu0.20.04.1 500
            500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
         12.2-4 500
            500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
    
    
&gt; apt-cache policy libc6
&gt; libc6:
      Installed: 2.31-0ubuntu9.9
      Candidate: 2.31-0ubuntu9.9
      Version table:
     *** 2.31-0ubuntu9.9 500
            500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            100 /var/lib/dpkg/status
         2.31-0ubuntu9.7 500
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
         2.31-0ubuntu9 500
            500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
    
&gt; apt-cache policy libc6-dev
&gt; libc6-dev:
      Installed: 2.31-0ubuntu9.9
      Candidate: 2.31-0ubuntu9.9
      Version table:
     *** 2.31-0ubuntu9.9 500
            500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            100 /var/lib/dpkg/status
         2.31-0ubuntu9.7 500
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
         2.31-0ubuntu9 500
            500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
</code></pre>
<p>As you can see, the version of libghc-postgresql-libpq-dev is: 0.9.4.2-1build1
I couldn't find the 0.9.4.3. Could be this the problem? where I can have the right one?</p>
<p>The funny part is that I can build the same project without errors in a Bash Terminal, inside of the nix shell, but outside the Vcode.</p>
<p>But when after entering into the nix shell, I enter in VCode, with <code>code .</code>, and I try again to build from a VCode terminal, I got that error.</p>
<p>I believe it could be something about the paths, but I compare the PATHS in the Terminal, and in the VCode Terminal, and they are the same.</p>
<p>What could be the difference between a normal console where it works, and from the same console I open the Vcode, and then it dosent works.</p>
<p>With others versio of Plutus Apps the Nix shell works ok, and inside the Vcode, I can build normally.</p>
<p>I might be confused with the works of nix shell and <code>code .</code>.</p>
<p>Thanks a lot!</p>

CC BY-SA 4.0
2022-11-09T21:38:15.160Z
Do you have `pkg-config` installed? `pkg-config --list-all | grep pq` should return at least one entry.
Erik de Castro Lopo
CC BY-SA 4.0
2022-11-09T23:13:24.907Z
pkg-config --list-all alone gave me some items, but no one with pq.
What could I do?
Manu Padilla
CC BY-SA 4.0
2022-11-10T01:18:26.983Z
The `pkg-config` file for `libpq` is in the `libpq-dev` package.
Erik de Castro Lopo
<plutus><cabal><build>
Error building in the latest Plutus Apps: Failed to build postgresql-libpq-0.9.4.3* Missing (or bad) C library: pq
# Error building in the latest Plutus Apps: Failed to build postgresql-libpq-0.9.4.3* Missing (or bad) C library: pq

(Asked by: username_0 on 2022-11-09)

Im having problems building my projects using the the latest plutus apps:
commit 33c6e81ba4ab9cbb42870bbb6f916f8b4e2c7b3e (HEAD -> main)
Starting     postgresql-libpq-0.9.4.3 (all, legacy fallback)

Failed to build postgresql-libpq-0.9.4.3. The failure occurred during the
configure step.
Build log (
/home/manuelpadilla/.cabal/logs/ghc-8.10.7/postgresql-libpq-0.9.4.3-57a09a91f3e131b3474d6ed3933505829ef2226dbf9a3540a78fc56124386c83.log
):
[1 of 1] Compiling Main             ( /home/manuelpadilla/source/copyRepos/RATS-DAO/rats-dao-devs-staking-plutus-v2/dist-newstyle/tmp/src-4327/postgresql-libpq-0.9.4.3/dist/setup/setup.hs, /home/manuelpadilla/source/copyRepos/RATS-DAO/rats-dao-devs-staking-plutus-v2/dist-newstyle/tmp/src-4327/postgresql-libpq-0.9.4.3/dist/setup/Main.o )
Linking /home/manuelpadilla/source/copyRepos/RATS-DAO/rats-dao-devs-staking-plutus-v2/dist-newstyle/tmp/src-4327/postgresql-libpq-0.9.4.3/dist/setup/setup ...
Configuring postgresql-libpq-0.9.4.3...
setup: Missing dependency on a foreign library:
* Missing (or bad) C library: pq
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.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

I installed all the postgresql libraries I believe I needed.
I installed:
> apt-cache policy postgresql
> postgresql:
      Installed: 15+244.pgdg20.04+1
      Candidate: 15+244.pgdg20.04+1
      Version table:
     *** 15+244.pgdg20.04+1 500
            500 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 Packages
            100 /var/lib/dpkg/status
         12+214ubuntu0.1 500
            500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
         12+214 500
            500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        
> apt-cache policy libghc-postgresql-libpq-dev
> libghc-postgresql-libpq-dev:
          Installed: 0.9.4.2-1build1
          Candidate: 0.9.4.2-1build1
          Version table:
         *** 0.9.4.2-1build1 500
                500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
                100 /var/lib/dpkg/status
    
> apt-cache policy libpq5
> libpq5:
      Installed: 15.0-1.pgdg20.04+1
      Candidate: 15.0-1.pgdg20.04+1
      Version table:
     *** 15.0-1.pgdg20.04+1 500
            500 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 Packages
            100 /var/lib/dpkg/status
         12.12-0ubuntu0.20.04.1 500
            500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
         12.2-4 500
            500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

> apt-cache policy libpq-dev
> libpq-dev:
      Installed: 15.0-1.pgdg20.04+1
      Candidate: 15.0-1.pgdg20.04+1
      Version table:
     *** 15.0-1.pgdg20.04+1 500
            500 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 Packages
            100 /var/lib/dpkg/status
         12.12-0ubuntu0.20.04.1 500
            500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
         12.2-4 500
            500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
    
    
> apt-cache policy libc6
> libc6:
      Installed: 2.31-0ubuntu9.9
      Candidate: 2.31-0ubuntu9.9
      Version table:
     *** 2.31-0ubuntu9.9 500
            500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            100 /var/lib/dpkg/status
         2.31-0ubuntu9.7 500
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
         2.31-0ubuntu9 500
            500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
    
> apt-cache policy libc6-dev
> libc6-dev:
      Installed: 2.31-0ubuntu9.9
      Candidate: 2.31-0ubuntu9.9
      Version table:
     *** 2.31-0ubuntu9.9 500
            500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
            100 /var/lib/dpkg/status
         2.31-0ubuntu9.7 500
            500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
         2.31-0ubuntu9 500
            500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

As you can see, the version of libghc-postgresql-libpq-dev is: 0.9.4.2-1build1
I couldn't find the 0.9.4.3. Could be this the problem? where I can have the right one?
The funny part is that I can build the same project without errors in a Bash Terminal, inside of the nix shell, but outside the Vcode.
But when after entering into the nix shell, I enter in VCode, with code ., and I try again to build from a VCode terminal, I got that error.
I believe it could be something about the paths, but I compare the PATHS in the Terminal, and in the VCode Terminal, and they are the same.
What could be the difference between a normal console where it works, and from the same console I open the Vcode, and then it dosent works.
With others versio of Plutus Apps the Nix shell works ok, and inside the Vcode, I can build normally.
I might be confused with the works of nix shell and code ..
Thanks a lot!

**Tags:** plutus, cabal, build
> **Comments:**
> **username_1**: Do you have `pkg-config` installed? `pkg-config --list-all | grep pq` should return at least one entry.  
> **username_0**: pkg-config --list-all alone gave me some items, but no one with pq. What could I do?  
> **username_1**: The `pkg-config` file for `libpq` is in the `libpq-dev` package.  

---

## 0 answers

