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 1jUzWd-00040l-Rc for pgsql-general@arkaria.postgresql.org; Sat, 02 May 2020 21:18:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jUzWb-0006Mq-EZ for pgsql-general@arkaria.postgresql.org; Sat, 02 May 2020 21:18:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jUzWb-0006Mj-6s for pgsql-general@lists.postgresql.org; Sat, 02 May 2020 21:18:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jUzWY-0004iS-Bi for pgsql-general@postgresql.org; Sat, 02 May 2020 21:18:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 042LIAoq001611; Sat, 2 May 2020 17:18:10 -0400 From: Tom Lane To: TalGloz cc: pgsql-general@postgresql.org Subject: Re: Compiling C Extension Functions against PostgreSQL 12 In-reply-to: <1588452776591-0.post@n3.nabble.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> <1588452776591-0.post@n3.nabble.com> Comments: In-reply-to TalGloz message dated "Sat, 02 May 2020 13:52:56 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1609.1588454290.1@sss.pgh.pa.us> Date: Sat, 02 May 2020 17:18:10 -0400 Message-ID: <1610.1588454290@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk TalGloz writes: > 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 Looking at your Makefile, it seems to be expecting that CXXFLAGS will be honored in the build, and it isn't being. As far as I can see from pgxs.mk, you're supposed to spell that PG_CXXFLAGS. Probably, it accidentally worked to do it the other way in v10, but no longer does, likely as a result of the fact that there's now some minimal amount of C++ code in core PG. I'm a little dubious about whether overriding CXX is a good idea now, too. (Likely the core setting is the same, but if it were pointing at a different compiler that could cause trouble.) regards, tom lane