Joey Morris wrote:
> This is my first attempt at using libpq, and I'm running across a strange
> problem. Here is my bare-bones program:
>
> #include
> #include "libpq-fe.h"
>
> int main(int argc, char **argv) {
> PGconn *conn;
> fprintf(stderr, "connecting\n");
> conn = PQconnectdb("dbnam
This is my first attempt at using libpq, and I'm running across a strange
problem. Here is my bare-bones program:
#include
#include "libpq-fe.h"
int main(int argc, char **argv) {
PGconn *conn;
fprintf(stderr, "connecting\n");
conn = PQconnectdb("dbname=postgres");
PQfinish(conn);
retur
Aurimas Černius wrote on Wed, Feb 18, 2009 at 05:01:14PM
+0200:
> Did you use *exactly* the same command line to compile both versions?
> What is that command line(s)?
Yes, I used the same compilation command line for both versions:
gcc -o pq_test -I"C:\Program Files\PostgreSQL\8.3\include" -L"
> How do you run the program, in console or by double clicking on
> executable. Try the second. Does the console window apear on the screen?
Aha! This tip has led to the solution. I had been running the program from
an emacs shell buffer. If I run it from the Windows console or by
double-clickin
On Wed, Feb 18, 2009 at 4:47 PM, Joey Morris wrote:
> This is my first attempt at using libpq, and I'm running across a strange
> problem. Here is my bare-bones program:
>
> #include
> #include "libpq-fe.h"
>
> int main(int argc, char **argv) {
> PGconn *conn;
> fprintf(stderr, "connecting\n")
On Wed, Feb 18, 2009 at 06:08:07PM +0200, Aurimas Cernius wrote:
> Joey Morris wrote:
> > gcc -o pq_test -I"C:\Program Files\PostgreSQL\8.3\include" -L"C:\Program
> > Files\PostgreSQL\8.3\lib" -lpq pq_test.c
gcc won't give many warnings unless you give it a -Wall flag; it may be
doing strange thi
David Wilson wrote on Wed, Feb 18, 2009 at
11:36:44AM -0500:
> Try adding "fflush(stderr);" after your fprintf() call. If the
> connection is hanging and output hasn't been flushed, you wouldn't see
> much.
No, this doesn't help, either. Thanks for the suggestion.
--
Sent via pgsql-general mai
On Wed, Feb 18, 2009 at 9:47 AM, Joey Morris wrote:
> I expected this program to print "connecting", but in fact I get no output
> whatsoever. If I comment out the PQconnectdb and PQfinish lines, I see
> "connecting" as expected. What could be going on here?
Try adding "fflush(stderr);" after yo
Hi,
Aurimas Černius wrote on Wed, Feb 18, 2009 at 06:08:07PM
+0200:
Libraries should be places after the source file, that is (not sure
about -L, but for -l surely):
gcc -o pq_test -I"C:\Program Files\PostgreSQL\8.3\include" pq_test.c
-L"C:\Program Files\PostgreSQL\8.3\lib" -lpq
I don't if
Aurimas Černius wrote on Wed, Feb 18, 2009 at 06:08:07PM
+0200:
> Libraries should be places after the source file, that is (not sure
> about -L, but for -l surely):
>
> gcc -o pq_test -I"C:\Program Files\PostgreSQL\8.3\include" pq_test.c
> -L"C:\Program Files\PostgreSQL\8.3\lib" -lpq
>
> I d
Hi,
Looks like you accidently wrote to me personnally, not to mailing list.
On Wed, Feb 18, 2009 at 10:01 AM, Aurimas Černius wrote:
Did you use *exactly* the same command line to compile both versions?
What is that command line(s)?
Yes, I used the same compilation command line for both ver
Lennin Caro wrote on Wed, Feb 18, 2009 at 06:53:32AM
-0800:
> try
> fprintf(stdout,"Connection \n");
> printf("Connection \n");
Thanks, but both produce the same behavior as fprintf(stderr, "Connection \n"):
It prints when the PQconnectdb and PQfinish lines are commented out but not
when they a
Hi,
This is my first attempt at using libpq, and I'm running across a strange
problem. Here is my bare-bones program:
#include
#include "libpq-fe.h"
int main(int argc, char **argv) {
PGconn *conn;
fprintf(stderr, "connecting\n");
conn = PQconnectdb("dbname=postgres");
PQfinish(con
> This is my first attempt at using libpq, and I'm running
> across a strange
> problem. Here is my bare-bones program:
>
> #include
> #include "libpq-fe.h"
>
> int main(int argc, char **argv) {
> PGconn *conn;
> fprintf(stderr, "connecting\n");
> conn = PQconnectdb("dbname=postgres");
>
This is my first attempt at using libpq, and I'm running across a strange
problem. Here is my bare-bones program:
#include
#include "libpq-fe.h"
int main(int argc, char **argv) {
PGconn *conn;
fprintf(stderr, "connecting\n");
conn = PQconnectdb("dbname=postgres");
PQfinish(conn);
retur
15 matches
Mail list logo