Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eAAVC-0003dE-3J for pgsql-general@arkaria.postgresql.org; Thu, 02 Nov 2017 08:05:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eAAVA-0006mq-IW for pgsql-general@arkaria.postgresql.org; Thu, 02 Nov 2017 08:05:24 +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.84_2) (envelope-from ) id 1eAAV9-0006ly-I3 for pgsql-general@postgresql.org; Thu, 02 Nov 2017 08:05:23 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1eAAV1-0001Pz-4j for pgsql-general@postgresql.org; Thu, 02 Nov 2017 08:05:22 +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 mx2.mailbox.org (Postfix) with ESMTPS id 6E6534CAC3; Thu, 2 Nov 2017 09:05:13 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id IjSGM6f2VrcH; Thu, 2 Nov 2017 09:05:06 +0100 (CET) Message-ID: <1509609905.3268.3.camel@cybertec.at> Subject: Re: Building tds_fdw Extension for Windows 64bit From: Laurenz Albe To: "Igal @ Lucee.org" , pgsql-general Date: Thu, 02 Nov 2017 09:05:05 +0100 In-Reply-To: <6d349bd6-572b-ce41-0bf7-0fd9baac8af8@lucee.org> References: <6d349bd6-572b-ce41-0bf7-0fd9baac8af8@lucee.org> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Igal @ Lucee.org wrote: > After reading Craig's excellent blog post at https://blog.2ndquadrant.com/compiling-postgresql-extensions-visual-studio-windows/ I decided to try and build a real extension - tds_fdw. > I've set it up in Visual Studio Community 2017, but am getting the following errors: > Error    C2375    'tds_fdw_handler': redefinition; different linkage    tds_fdw    E:\Workspace\git\tds_fdw\src\tds_fdw.c    118    > Error    C2375    'tds_fdw_validator': redefinition; different linkage    tds_fdw    E:\Workspace\git\tds_fdw\src\tds_fdw.c    156    > Full output: > 1>------ Rebuild All started: Project: tds_fdw, Configuration: Release x64 ------ > 1>deparse.c > 1>options.c > 1>tds_fdw.c > 1>src\tds_fdw.c(118): error C2375: 'tds_fdw_handler': redefinition; different linkage > 1>E:\Workspace\git\tds_fdw\include\tds_fdw.h(130): note: see declaration of 'tds_fdw_handler' > 1>src\tds_fdw.c(156): error C2375: 'tds_fdw_validator': redefinition; different linkage > 1>E:\Workspace\git\tds_fdw\include\tds_fdw.h(131): note: see declaration of 'tds_fdw_validator' > 1>Generating Code... > 1>Done building project "tds_fdw.vcxproj" -- FAILED. > ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== > I'm not sure if it's related, but the FreeTDS version that I found for Windows is marked as 32bit and I am trying to build for 64bit. > I believe that extensions like tds_fdw and pgloader will help users on TDS databases to migrate to Postgres and will improve adoption of the project.  I will be more than happy to publish my binaries of the extension if I ever get that far. > Can anyone help? Based on my experience with oracle_fdw, I would change the function declaration in tds_fdw.h to extern PGDLLEXPORT Datum tds_fdw_handler(PG_FUNCTION_ARGS); Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general