Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jUz8D-000333-9B for pgsql-general@arkaria.postgresql.org; Sat, 02 May 2020 20:53:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jUz89-0004nc-J1 for pgsql-general@arkaria.postgresql.org; Sat, 02 May 2020 20:53:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jUz89-0004nU-BC for pgsql-general@lists.postgresql.org; Sat, 02 May 2020 20:53:01 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jUz85-0007Q9-OX for pgsql-general@postgresql.org; Sat, 02 May 2020 20:53:00 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 910401D14560D for ; Sat, 2 May 2020 13:52:56 -0700 (MST) Date: Sat, 2 May 2020 13:52:56 -0700 (MST) From: TalGloz To: pgsql-general@postgresql.org Message-ID: <1588452776591-0.post@n3.nabble.com> In-Reply-To: <9443e9f9-1eec-d4f5-eb19-fb6d1da9c587@aklaver.com> References: <1588447687198-0.post@n3.nabble.com> <4edd59f3-4d95-c41c-6839-7d022946f8d4@aklaver.com> <1588448354769-0.post@n3.nabble.com> <1b0a4606-2964-48ef-0736-ff51db2d2e1d@aklaver.com> <1588449802471-0.post@n3.nabble.com> <1588450167090-0.post@n3.nabble.com> <9443e9f9-1eec-d4f5-eb19-fb6d1da9c587@aklaver.com> Subject: Re: Compiling C Extension Functions against PostgreSQL 12 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Adrian Klaver-4 wrote > On 5/2/20 1:09 PM, TalGloz wrote: >> Adrian Klaver-4 wrote > >> >> Yes, they were created when using make against Postgres 10 and I clean >> them >> every time when I try a different version of Postgres. > > Well I'm reaching the end of what I can do. All I have left is that the > examples I have seen use: > > #include "postgres.h" > > not > > #include > >> >> TalGloz > > > > -- > Adrian Klaver > adrian.klaver@ If it works for Postgres 10 it should also work for 12. I've changed from #include to #include "postgres.h" and I still get the same error with Postgres 12 and it complies without any problem with Postgres 10 I dont understand why the output for Postgres 12 g++ -Wall -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -o seal_diff_cpp.o -c seal_diff_cpp.cpp seal_diff_cpp.cpp:2:10: fatal error: postgres.h: No such file or directory 2 | #include "postgres.h" | ^~~~~~~~~~~~ looks different form the ones of Postgres 10 g++ -std=c++17 -fPIC -Wall -Werror -g -O0 -pthread -I/usr/pgsql-10/include/server -I/usr/local/include -I/usr/local/include/cppcodec -o seal_diff_cpp.o -c seal_diff_cpp.cpp g++ -shared -o seal_diff_cpp.so seal_diff_cpp.o -L/usr/pgsql-12/lib -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-12/lib',--enable-new-dtags -L/usr/local/lib -lseal -pthread All the includes with "-I" and "-std=c++17 -fPIC" are from the first line gone. I even tried to use fixed paths in my Makefiles: "PGXS = /usr/pgsql-12/lib/pgxs/src/makefiles/pgxs.mk" and "INCLUDEDIR = /usr/pgsql-12/include/server". TalGloz -- Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html