problems with libpq on windows - Mailing list pgsql-interfaces

From Egidijus Kizlaitis
Subject problems with libpq on windows
Date
Msg-id 000f01c15eee$1b769c30$0e00a8c0@xxl101.xxl101.lt
Whole thread Raw
List 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@Z)
 
what am i doing wrong?
 
thanx
Egidijus
 
 
 
 

pgsql-interfaces by date:

Previous
From: Antonio Sergio de Mello e Souza
Date:
Subject: Fetching fields of a cursor into a struct, with ECPG
Next
From: Gilberto Ribeiro de Queiroz
Date:
Subject: How to obtain the size of a field VARCHAR, NUMERIC(7,2) after a query with libpq?