Thread: plea for Windows build help

plea for Windows build help

From
Blaine Simpson
Date:
I'm trying to build the default 32 bit dll on Windows using MS Visual
C++ from the command line.  I have searched this mailing list but found
no discussion of these problems.

I've followed the "COMMAND LINE METHOD" instructions in
win32-compilation.html, except for using the currently available
versions of slproweb's OpenSSL distro and Visual C++ Express.  In an
unsuccessful attempt to avoid complications, I started with the last
bundled source distro, psqlodbc-08.03.0400.tar.gz
<http://wwwmaster.postgresql.org/download/mirrors-ftp/odbc/versions/src/psqlodbc-08.03.0400.tar.gz>.
My PC is running 32 bit Vista.

First, I changed the "afxres.h" reference in psqldb.rc to "windows.h",
since afxres.h does not exist anywhere on my PC, and added

  #ifdef IDC_STATIC
  #undef IDC_STATIC
  #endif
  #define IDC_STATIC (-1)  // all static controls

to psqldb.rc (I guess this constant is probably intended to be set in
afxres.h?).  With these changes, I get all the way to the final link,
whereupon I get

  socket.obj : error LNK2001: unresolved external symbol _getaddrinfo@16
  socket.obj : error LNK2001: unresolved external symbol _freeaddrinfo@4
  socket.obj : error LNK2019: unresolved external symbol
__imp__getnameinfo@28 referenced in function _SOCK_connect_to
.\Release\psqlodbc35w.dll : fatal error LNK1120: 3 unresolved externals

from link.exe.  Internet searches say that these symbols should be
defined in ws2_32.dll, but once again, ws2_32.dll does not exist
anywhere on my PC.  I see that the winsock dll's are present in
\Windows\system32, and I'd think they should be capable of basic address
resolution.

Any tips would be greatly appreciated.

Re: plea for Windows build help

From
Shoaib Naazir
Date:
Blain,
 
I dont know why afxres.h is not present on your system. It should be the part of the distro or vc install but you can fix the link errors by adding
ws2_32.lib in your library references. The dll is not used by the linker :).
 
Shoaib.

Artificial intelligence is no match for natural stupidity!!
 
Beta Tester Badge 2




> Date: Wed, 28 Jan 2009 13:43:23 -0500
> From: blaine.simpson@admc.com
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] plea for Windows build help
>
> I'm trying to build the default 32 bit dll on Windows using MS Visual
> C++ from the command line. I have searched this mailing list but found
> no discussion of these problems.
>
> I've followed the "COMMAND LINE METHOD" instructions in
> win32-compilation.html, except for using the currently available
> versions of slproweb's OpenSSL distro and Visual C++ Express. In an
> unsuccessful attempt to avoid complications, I started with the last
> bundled source distro, psqlodbc-08.03.0400.tar.gz
> <http://wwwmaster.postgresql.org/download/mirrors-ftp/odbc/versions/src/psqlodbc-08.03.0400.tar.gz>.
> My PC is running 32 bit Vista.
>
> First, I changed the "afxres.h" reference in psqldb.rc to "windows.h",
> since afxres.h does not exist anywhere on my PC, and added
>
> #ifdef IDC_STATIC
> #undef IDC_STATIC
> #endif
> #define IDC_STATIC (-1) // all static controls
>
> to psqldb.rc (I guess this constant is probably intended to be set in
> afxres.h?). With these changes, I get all the way to the final link,
> whereupon I get
>
> socket.obj : error LNK2001: unresolved external symbol _getaddrinfo@16
> socket.obj : error LNK2001: unresolved external symbol _freeaddrinfo@4
> socket.obj : error LNK2019: unresolved external symbol
> __imp__getnameinfo@28 referenced in function _SOCK_connect_to
> .\Release\psqlodbc35w.dll : fatal error LNK1120: 3 unresolved externals
>
> from link.exe. Internet searches say that these symbols should be
> defined in ws2_32.dll, but once again, ws2_32.dll does not exist
> anywhere on my PC. I see that the winsock dll's are present in
> \Windows\system32, and I'd think they should be capable of basic address
> resolution.
>
> Any tips would be greatly appreciated.
>
> --
> Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-odbc


Windows Live™: E-mail. Chat. Share. Get more ways to connect. Check it out.

Re: plea for Windows build help

From
Blaine Simpson
Date:
That worked.  Thanks so much!

FYI, ws2_32 is present on my system.  Windows searches were not seeing
it because it's considered hidden for some reason.  The visibility
doesn't account for the problem though, because I retried building from
an administration shell, and tried all different values for IDC_STATIC,
to no effect.  I have no idea why the functions which I am told are in
ws2_32.lib are not accessible.  All of the other details that I
mentioned (other than ws2_32.dll not being present) are accurate.

So now I'm on to trying to build the installer.  New question to follow
in separate post.

Thanks


Shoaib Naazir wrote:
> Blain,
>
> I dont know why afxres.h is not present on your system. It should be
> the part of the distro or vc install but you can fix the link errors
> by adding
> ws2_32.lib in your library references. The dll is not used by the
> linker :).
>
> Shoaib.
>
> *Artificial intelligence is no match for natural stupidity!!*
> **
> *Beta Tester Badge 2*
>
>
>
>
> > Date: Wed, 28 Jan 2009 13:43:23 -0500
> > From: blaine.simpson@admc.com
> > To: pgsql-odbc@postgresql.org
> > Subject: [ODBC] plea for Windows build help
> >
> > I'm trying to build the default 32 bit dll on Windows using MS Visual
> > C++ from the command line. I have searched this mailing list but found
> > no discussion of these problems.
> >
> > I've followed the "COMMAND LINE METHOD" instructions in
> > win32-compilation.html, except for using the currently available
> > versions of slproweb's OpenSSL distro and Visual C++ Express. In an
> > unsuccessful attempt to avoid complications, I started with the last
> > bundled source distro, psqlodbc-08.03.0400.tar.gz
> >
> <http://wwwmaster.postgresql.org/download/mirrors-ftp/odbc/versions/src/psqlodbc-08.03.0400.tar.gz>.
>
> > My PC is running 32 bit Vista.
> >
> > First, I changed the "afxres.h" reference in psqldb.rc to "windows.h",
> > since afxres.h does not exist anywhere on my PC, and added
> >
> > #ifdef IDC_STATIC
> > #undef IDC_STATIC
> > #endif
> > #define IDC_STATIC (-1) // all static controls
> >
> > to psqldb.rc (I guess this constant is probably intended to be set in
> > afxres.h?). With these changes, I get all the way to the final link,
> > whereupon I get
> >
> > socket.obj : error LNK2001: unresolved external symbol _getaddrinfo@16
> > socket.obj : error LNK2001: unresolved external symbol _freeaddrinfo@4
> > socket.obj : error LNK2019: unresolved external symbol
> > __imp__getnameinfo@28 referenced in function _SOCK_connect_to
> > .\Release\psqlodbc35w.dll : fatal error LNK1120: 3 unresolved externals
> >
> > from link.exe. Internet searches say that these symbols should be
> > defined in ws2_32.dll, but once again, ws2_32.dll does not exist
> > anywhere on my PC. I see that the winsock dll's are present in
> > \Windows\system32, and I'd think they should be capable of basic address
> > resolution.
> >
> > Any tips would be greatly appreciated.