pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Igal @ Lucee.org <igal@lucee.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Building tds_fdw Extension for Windows 64bit
Date: Thu, 2 Nov 2017 11:00:25 -0700
Message-ID: <1bfa8ecf-505f-0c7d-b3d7-d3ecfdd4cc74@lucee.org> (raw)
In-Reply-To: <28459.1509637214@sss.pgh.pa.us>
References: <6d349bd6-572b-ce41-0bf7-0fd9baac8af8@lucee.org>
	<1509609905.3268.3.camel@cybertec.at>
	<21b32984-8b50-60c2-0263-17aaa3ed61ce@lucee.org>
	<28459.1509637214@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

On 11/2/2017 8:40 AM, Tom Lane wrote:
> It looks to me like MSVC is complaining about the PGDLLEXPORT
> markings that tds_fdw.c has on the function definitions
> (not the extern declarations).  In the core code we only put
> PGDLLEXPORT in extern declarations ... so try keeping it in
> the externs and removing it from the .c file.
>
> You may still get warnings that way, which I think you probably
> have to live with, unless you want to make a .DEF file or use
> --export-all-symbols as a substitute for PGDLLEXPORT'ing specific
> functions.  For some sorry history around this see
>
> https://www.postgresql.org/message-id/flat/A737B7A37273E048B164557ADEF4A58B539300BD%40ntex2010a.host...
>
> 			regards, tom lane

Tom, thank you for chiming in on this.  I usually write Java code so am 
not very familiar with C/C++ or the inner workings of DLLs.  I would 
love to be able to compile this extension though, as it will help me and 
others migrate databases from MS SQL to Postgres.

I removed the PGDLLEXPORT declarations from _tds_fdw.c_ and added a 
_deffile_ (tried to rename it to _tds_fdw.def_ but VS2017 complained 
that it can't find _deffile_ so I renamed it back).  It looks like a 
similar concept as a MANIFEST.MF file in OSGi in Java where the manifest 
declares which packages are exported and which are imported.

So now I am getting the errors below.  Do I need to add an entry in 
_deffile_ for each error message?  What does the entry look like?

1>------ Rebuild All started: Project: tds_fdw, Configuration: Release 
x64 ------
1>deparse.c
1>options.c
1>tds_fdw.c
1>Generating Code...
1>   Creating library E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.lib 
and object E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.exp
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbbind 
referenced in function tdsGetRowCountShowPlanAll
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbclose 
referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcmd 
referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcolname 
referenced in function tdsGetColumnMetadata
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcoltype 
referenced in function tdsGetColumnMetadata
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbconvert 
referenced in function tdsConvertToCString
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbiscount 
referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcount 
referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdata 
referenced in function tdsIterateForeignScan
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdatecrack 
referenced in function tdsDatetimeToDatum
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdatlen 
referenced in function tdsIterateForeignScan
1>tds_fdw.obj : error LNK2019: unresolved external symbol dberrhandle 
referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbexit 
referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbinit 
referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dblogin 
referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbloginfree 
referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbmsghandle 
referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbnextrow 
referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbnumcols 
referenced in function tdsGetRowCountShowPlanAll
1>tds_fdw.obj : error LNK2019: unresolved external symbol tdsdbopen 
referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbresults 
referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsqlexec 
referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbuse 
referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbwillconvert 
referenced in function tdsConvertToCString
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsetlname 
referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsetlversion 
referenced in function tdsSetupConnection
1>E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.dll : fatal error 
LNK1120: 26 unresolved externals
1>Done building project "tds_fdw.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Thanks again,

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/;

view thread (6+ messages)  latest in thread

Message-ID: <1bfa8ecf-505f-0c7d-b3d7-d3ecfdd4cc74@lucee.org>
Permalink:  ../1bfa8ecf-505f-0c7d-b3d7-d3ecfdd4cc74@lucee.org/
Also on:    postgresql.org/message-id/1bfa8ecf-505f-0c7d-b3d7-d3ecfdd4cc74@lucee.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: igal@lucee.org, tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at
  Subject: Re: Building tds_fdw Extension for Windows 64bit
  In-Reply-To: <1bfa8ecf-505f-0c7d-b3d7-d3ecfdd4cc74@lucee.org>
  References: <6d349bd6-572b-ce41-0bf7-0fd9baac8af8@lucee.org> <1509609905.3268.3.camel@cybertec.at> <21b32984-8b50-60c2-0263-17aaa3ed61ce@lucee.org> <28459.1509637214@sss.pgh.pa.us> <1bfa8ecf-505f-0c7d-b3d7-d3ecfdd4cc74@lucee.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox