Thread: How can I run installcheck using powershell ?

How can I run installcheck using powershell ?

From
Dave Cramer
Date:
Is there a way to run the tests ?

Alternatively nmake is giving me:
 error LNK2019: unresolved external symbol __vsnwprintf_s referenced in function _StringCchPrintfW


Dave Cramer

Re: How can I run installcheck using powershell ?

From
Michael Paquier
Date:
On Wed, Jul 20, 2016 at 6:09 AM, Dave Cramer <davecramer@gmail.com> wrote:
> Is there a way to run the tests ?
>
> Alternatively nmake is giving me:
>  error LNK2019: unresolved external symbol __vsnwprintf_s referenced in
> function _StringCchPrintfW

Hm. I am not seeing this error on Windows using nmake from VS 2013
when compiling the tests..
--
Michael


Re: How can I run installcheck using powershell ?

From
Dave Cramer
Date:
Hi Michael,

I am using VC2015, which is probably the cause

Dave Cramer

On 19 July 2016 at 19:56, Michael Paquier <michael.paquier@gmail.com> wrote:
On Wed, Jul 20, 2016 at 6:09 AM, Dave Cramer <davecramer@gmail.com> wrote:
> Is there a way to run the tests ?
>
> Alternatively nmake is giving me:
>  error LNK2019: unresolved external symbol __vsnwprintf_s referenced in
> function _StringCchPrintfW

Hm. I am not seeing this error on Windows using nmake from VS 2013
when compiling the tests..
--
Michael

Re: How can I run installcheck using powershell ?

From
Michael Paquier
Date:
On Wed, Jul 20, 2016 at 9:10 AM, Dave Cramer <davecramer@gmail.com> wrote:
> I am using VC2015, which is probably the cause

From which file(s) is the error coming? This strongly smells like a
patch using _MSC_VER is needed.
--
Michael


Re: How can I run installcheck using powershell ?

From
Dave Cramer
Date:
Michael,

Here is the complete link error

       link.exe @C:\Users\DAVECR~1\AppData\Local\Temp\nm45D.tmp
   Creating library .\_Unicode_Release\psqlodbc35w.lib and object .\_Unicode_Release\psqlodbc35w.exp
odbccp32.lib(dllload.obj) : error LNK2019: unresolved external symbol __vsnwprintf_s referenced in function _StringCchPrintfW
.\_Unicode_Release\psqlodbc35w.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.exe"' : return code '0x460'

Thanks!

Dave Cramer

On 19 July 2016 at 20:33, Michael Paquier <michael.paquier@gmail.com> wrote:
On Wed, Jul 20, 2016 at 9:10 AM, Dave Cramer <davecramer@gmail.com> wrote:
> I am using VC2015, which is probably the cause

From which file(s) is the error coming? This strongly smells like a
patch using _MSC_VER is needed.
--
Michael

Re: How can I run installcheck using powershell ?

From
Michael Paquier
Date:
On Wed, Jul 20, 2016 at 9:55 AM, Dave Cramer <davecramer@gmail.com> wrote:
> Here is the complete link error
>
>        link.exe @C:\Users\DAVECR~1\AppData\Local\Temp\nm45D.tmp
>    Creating library .\_Unicode_Release\psqlodbc35w.lib and object
> .\_Unicode_Release\psqlodbc35w.exp
> odbccp32.lib(dllload.obj) : error LNK2019: unresolved external symbol
> __vsnwprintf_s referenced in function _StringCchPrintfW
> .\_Unicode_Release\psqlodbc35w.dll : fatal error LNK1120: 1 unresolved
> externals
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
> 14.0\VC\BIN\link.exe"' : return code '0x460'

OK, I can see it. After some research, VS is, as usual, a pain to work with:

https://connect.microsoft.com/VisualStudio/feedback/details/1134693/vs-2015-ctp-5-c-vsnwprintf-s-and-other-functions-are-not-exported-in-appcrt140-dll-breaking-linkage-of-static-libraries
In this case it seems that __vsnwprintf_s is not DLL-exported, causing
the linking error. And a solution is to add
legacy_stdio_definitions.lib to fix that where odbccp32.lib is listed.
Like in the patch attached.

You could as well enforce the presence of this lib in CUSTOMLINKLIBS,
but I'd rather see win64.mak support natively the newest versions of
VS instead of the old ones.
--
Michael

Attachment

Re: How can I run installcheck using powershell ?

From
Tom Lane
Date:
Dave Cramer <davecramer@gmail.com> writes:
> Here is the complete link error

>        link.exe @C:\Users\DAVECR~1\AppData\Local\Temp\nm45D.tmp
>    Creating library .\_Unicode_Release\psqlodbc35w.lib and object
> .\_Unicode_Release\psqlodbc35w.exp
> odbccp32.lib(dllload.obj) : error LNK2019: unresolved external symbol
> __vsnwprintf_s referenced in function _StringCchPrintfW
> .\_Unicode_Release\psqlodbc35w.dll : fatal error LNK1120: 1 unresolved
> externals
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
> 14.0\VC\BIN\link.exe"' : return code '0x460'

Googling for __vsnwprintf_s indicates that it was turned into an inline
function in VS2015:

https://connect.microsoft.com/VisualStudio/feedback/details/1134693/vs-2015-ctp-5-c-vsnwprintf-s-and-other-functions-are-not-exported-in-appcrt140-dll-breaking-linkage-of-static-libraries

They seem to be asserting that you wouldn't be seeing this problem if
all program components were built with the same VS version.

            regards, tom lane


Re: How can I run installcheck using powershell ?

From
Michael Paquier
Date:
On Wed, Jul 20, 2016 at 10:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> They seem to be asserting that you wouldn't be seeing this problem if
> all program components were built with the same VS version.

Even if you build Postgres libs with VS2015 and link pgodbc
compilation to that, the linking problem still shows up btw.
--
Michael