problem whith libpq

Поиск
Список
Период
Сортировка
От loic lecoeur
Тема problem whith libpq
Дата
Msg-id 20000204073928.15965.qmail@web1005.mail.yahoo.com
обсуждение исходный текст
Список pgsql-ports
I am a french student and i must do a sql database
witch interract with a vxworks system.

My solution is to use a client/serveur in C and a sql
database controled by a C program
Is it the best solution??
if no what is it?
if yes,i wrote a test program in c but it doesn't
work.
he is based on your example "sample program" at the
end of the chapter 16 of your documentation
can you tell me why i can't compile it ?
there is all the code of the application here
If you can't help me , can you give me a place or mail
of persons who can help me ?
Thank you :)

//command for postmaster

postmaster -i -p 12032 -D /home/magic/db

//source code of the test application testpqlib.c:

#include <stdio.h>
#include <pgsql/pqlib-fe.h>



void exit_nicely(PGconn *conn)
{
    PQfinish(conn);
    exit(1);
}


main()
{
    char         *pghost,
                *pgport,
            *pgoption,
            *pgtty,
            *dbname;
    PGconn        *conn;
    PGresult    *res;
    char toto[]="12032";

    /*initialisation des parametres de la connection*/
    pghost=NULL;
    pgport=toto;
    pgoption=NULL;
    pgtty=NULL;
    dbname="projet";
    /*etablissement de la connection*/
    conn=PQsetdb(pghost,pgport,pgoption,pgtty,dbname);
    /*test de la connection a la bdd*/
    if (PQstatus(conn)==CONNECTION_BAD)
    {
        printf("connection échouée");
        printf("%s",PQerrorMessage(conn));
        exit_nicely(conn);
    }
    exit_nicely(conn);
}

//command for compilation

gcc testpqlib.c -o testpqlib

//output errors of the compilator:

[magic@profs testsdivers]$ gcc testpqlib.c -o
testpqlib
/tmp/ccmMWakA.o: In function `exit_nicely':
/tmp/ccmMWakA.o(.text+0x8): undefined reference to
`PQfinish'
/tmp/ccmMWakA.o: In function `main':
/tmp/ccmMWakA.o(.text+0x88): undefined reference to
`PQsetdbLogin'
/tmp/ccmMWakA.o(.text+0x99): undefined reference to
`PQstatus'
/tmp/ccmMWakA.o(.text+0xb9): undefined reference to
`PQerrorMessage'

loic lecoeur
Caen (France)
___________________________________________________________
Do You Yahoo!?
Achetez, vendez! À votre prix! Sur http://encheres.yahoo.fr

В списке pgsql-ports по дате отправления:

Предыдущее
От: offer@greekcentralmail.com
Дата:
Сообщение: Special Offer!! 50 Free Minutes!
Следующее
От: Horák Daniel
Дата:
Сообщение: RE: [PORTS] NT running problems