X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 95A1D52971 for ; Fri, 1 Apr 2005 03:13:17 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77042-05 for ; Fri, 1 Apr 2005 02:13:07 +0000 (GMT) Received: from smtp-vbr1.xs4all.nl (smtp-vbr1.xs4all.nl [194.109.24.21]) by svr1.postgresql.org (Postfix) with ESMTP id 5516A52A68 for ; Fri, 1 Apr 2005 03:13:06 +0100 (BST) Received: from webmail.xs4all.nl (webmail12.xs4all.nl [194.109.22.172]) by smtp-vbr1.xs4all.nl (8.12.11/8.12.11) with ESMTP id j312D5IY044193; Fri, 1 Apr 2005 04:13:05 +0200 (CEST) (envelope-from jtv@xs4all.nl) Received: from 202.47.227.25 by webmail.xs4all.nl with HTTP; Fri, 1 Apr 2005 04:13:05 +0200 (CEST) Message-ID: <13236.202.47.227.25.1112321585.squirrel@202.47.227.25> In-Reply-To: <424C7925.9060002@innovision.com> References: <424ADDC0.8070603@innovision.com> <24826.202.47.227.25.1112239744.squirrel@202.47.227.25> <424C7925.9060002@innovision.com> Date: Fri, 1 Apr 2005 04:13:05 +0200 (CEST) Subject: Re: libpq: Newbie help w/ data type conversions on From: jtv@xs4all.nl To: "Marvin Bellamy" Cc: pgsql-interfaces@postgresql.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.228 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200504/1 X-Sequence-Number: 5417 Marvin Bellamy wrote: > I'm building for MSVC 7.1.3088, VS .NET 2003 on Win XP. I copied the > compiler headers and pointed the common file attributes to my PostgreSQL > install and I get this error: > > [snip] > ..\src\util.cxx(60) : warning C4244: 'initializing' : conversion from > 'double' to 'const float', possible loss of data > ..\src\util.cxx(60) : error C2124: divide or mod by zero Ah, that's a bit of workaround code for compilers that don't have proper ways of producing NANs. The sample configuration headers for your compiler don't say yet whether those proper ways are available, so the code assumes the worst and reverts to divide-by-zero (strictly at compile time, mind you, so neither the warning or the error is really appropriate) to generate NaNs. Easiest fix: define the PQXX_HAVE_QUIET_NAN preprocessor macro. If that doesn't work (i.e. if the compiler doesn't provide quiet_NaN()), define PQXX_HAVE_NAN instead. I can release an update over the coming days that fixes this, once I'm sure about what works. > I was able to build libpqxx with cygwin (which probably uses gcc), but > it produced libpqxx.la and libpqxx.a. Since my IDE is Visual Studio > .NET 2003, I'm not sure if I can use them in a MSVC app (mind you I'm > still learning about native development as a Java developer). This was Correct on both counts: cygwin uses gcc, and you can't link object files or libraries (they're actually almost the same thing) from one C++ compiler with those of another. The latter is one of the more annoying aspects of life with C++, and there are complex but good reasons for this restruction--although thankfully some standardization is happening. Jeroen