[Oledb-dev] Visual C++ 2005 Express

Helmar Spangenberg hspangenberg at frey.de
Tue Jul 24 07:34:27 UTC 2007


Am Dienstag, 24. Juli 2007 00:15 schrieben Sie:
> PgOleDb.dll depends on libpq.dll. To register the provider you need path to
> Program Files\PostgreSQL\8.2\bin or simply copy all dlls from the bin to
> your project debug folder.

I compiled PostgreSQL 8.2.4 (at least those parts which were set up for the 
Microsoft compiler). The resulting psql complained of a missing libpq.dll. 
But after copying the dll to \windows\system32 the error diappeared and psql 
was functional (I connected it to a postgres server on a different computer).

So I thought everything should be fine for PgOleDb.

Nevertheless, I copied libpq.dll into the PgOleDb folder and recompiled the 
project. Unfortunately it did not register either.

Then I tried to register libpq.dll manually. Even that did not work (module 
not found). Do you have any ideas concerning that?

>
> You should not change any MS headers (like you did for atldb.h) to compile
> the provider under VS2005.

Actually, changing headers of an SDK would be the last thing I intend to do, 
however in this case it seemed to be necessary - maybe MS has changed their 
compiler philosophy or whatever...
C++ has/had an ambiguous definition on the scope of variables defined in the 
head of e.g. a for-loop. In atldb.h, you can find lots of constructs of the 
type
for(int i=0; i<xyz; ++i)
{
   ....
}
if(i > abc) {....}

I know, this worked fine with former MS compilers, however VS2005 does NOT 
like it at all. So what I did simply was pulling the declaration out of the 
for-head, e.g.
int i;
for(i=0; i<xyz; ++i) {...}
if(i > abc){...}

Again I admit, it is not good style to change those files, but for me it 
seemed to be the only way to get the compiler satisfied... ;-)

Helmar



More information about the Oledb-devel mailing list