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 1fou7U-0002er-Hb for pgsql-general@arkaria.postgresql.org; Sun, 12 Aug 2018 17:25:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fou7S-0007Vn-AT for pgsql-general@arkaria.postgresql.org; Sun, 12 Aug 2018 17:25:34 +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 1fou7S-0007Vg-2g for pgsql-general@lists.postgresql.org; Sun, 12 Aug 2018 17:25:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fou7K-0000OY-IU for pgsql-general@postgresql.org; Sun, 12 Aug 2018 17:25:33 +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 w7CHPL7R027566; Sun, 12 Aug 2018 13:25:21 -0400 From: Tom Lane To: TalGloz cc: pgsql-general@postgresql.org Subject: Re: PostgreSQL C Language Extension with C++ Code In-reply-to: <1534093538827-0.post@n3.nabble.com> References: <1534093538827-0.post@n3.nabble.com> Comments: In-reply-to TalGloz message dated "Sun, 12 Aug 2018 10:05:38 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27564.1534094721.1@sss.pgh.pa.us> Date: Sun, 12 Aug 2018 13:25:21 -0400 Message-ID: <27565.1534094721@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk TalGloz writes: > I've searched information about my problem in the archives and on the > internet, but it didn't help. I have this small myfunc.cpp > [ that doesn't work ] > 16: #ifdef PG_MODULE_MAGIC > 17: PG_MODULE_MAGIC; > 18: #endif Hmm ... don't use an #ifdef there. If you don't have the macro defined, you want to fail, not silently build an extension without it. It's possible you need extern "C" { ... } around the macro, too. regards, tom lane