problems with libpq on windows

From: "Egidijus Kizlaitis" <egidijus(at)xxl101(dot)lt>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: problems with libpq on windows
Date: 2001-10-27 13:48:49
Message-ID: 000f01c15eee$1b769c30$0e00a8c0@xxl101.xxl101.lt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi

i am developing windows c++ application using libpq. i am using binary cursor to select table data.
how do i retrieve timestamp data from table? how can i convert it to time_t or struct tm?

char* val = PQgetvalue(pgres,i,j);

for numbers code looks like that:
nVal = * ((int *) val);

for timestamp i tryied this code:

#include "postgres.h"
#include "utils/timestamp.h"

.....

tmstampVal = * (Timestamp*) val;
timestamp2tm(tmstampVal, &tzp, &sttm, &fsec, (char**)&tzn);

.....

but then compiling program i got error:
error LNK2001: unresolved external symbol "int __cdecl timestamp2tm(double,int *,struct tm *,double *,char * *)" (?timestamp2tm@@YAHNPAHPAUtm@@PANPAPAD(at)Z)

what am i doing wrong?

thanx
Egidijus

Browse pgsql-interfaces by date

  From Date Subject
Next Message Gilberto Ribeiro de Queiroz 2001-10-27 20:30:33 How to obtain the size of a field VARCHAR, NUMERIC(7, 2) after a query with libpq?
Previous Message Antonio Sergio de Mello e Souza 2001-10-26 16:21:21 Fetching fields of a cursor into a struct, with ECPG