Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1freDr-0002st-0P for pgsql-general@arkaria.postgresql.org; Mon, 20 Aug 2018 07:03:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1freDo-0004Nt-VS for pgsql-general@arkaria.postgresql.org; Mon, 20 Aug 2018 07:03:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1freDo-0004Nj-Ne for pgsql-general@lists.postgresql.org; Mon, 20 Aug 2018 07:03:28 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1freDh-0002tI-Ft for pgsql-general@postgresql.org; Mon, 20 Aug 2018 07:03:28 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 95EB5490BB; Mon, 20 Aug 2018 09:03:19 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id mFQeWb5MgzxT; Mon, 20 Aug 2018 09:03:18 +0200 (CEST) Message-ID: <1534748597.2593.2.camel@cybertec.at> Subject: Re: including header files in a C extension From: Laurenz Albe To: TalGloz , pgsql-general@postgresql.org Date: Mon, 20 Aug 2018 09:03:17 +0200 In-Reply-To: <1534526664316-0.post@n3.nabble.com> References: <1534526664316-0.post@n3.nabble.com> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk TalGloz wrote: > If I have an external library that I install using make install into the > /usr/local/include/libraryname path by default and I want to include it in a > C extension, the Makefile for the .so file includes the headers in > /usr/local/include/libraryname path. > > Can I use #include when writing C/CPP code for my > PostgreSQL C extension or do I have to install the external library in a > different path than /usr/local/include/libraryname. I think that the > external library headers are not getting included. > > I do manage to build the .so file without error..... If you can build the extension, what is your problem? Usually you use the LDFLAGS to tell "make" where to find your headers. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com