From: | "isaac flemmin" <isaac(at)knox(dot)net> |
---|---|
To: | <pgsql-interfaces(at)postgresql(dot)org> |
Subject: | libpq++ compiling errors... |
Date: | 2002-01-30 00:53:07 |
Message-ID: | 000001c1a928$7bfe8bb0$dcad2204@ixic |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
Hello again,
Okay, now that I have some time to concentrate on getting programs using
the libpq and/or libpq++ to compile I will try this message again. I am
using PostgreSQL 7.1.3, glibc-2.2.4-19.3 and gcc-2.96-85. Any time I try
to compile a program that uses the libpq or the libpq++ headers or
libraries i get errors. When I installed PostgreSQL i used both make
install, and make install-all-headers to ensure that all the header
files were copied to the system and I did both the commands as root. I
have included some of the output I get when I try compiling different
ways.
The first example is when I try to run make in the libpq++/examples
directory.
PWD =
/home/tech/isaac/postgres/postgresql-7.1.3/src/interfaces/libpq++/exampl
es
g++ -I/usr/local/pgsql/include -o testlibpq0 testlibpq0.cc
-L/usr/local/pgsql/lib -lpq++
In file included from testlibpq0.cc:18:
../libpq++.h:27:34: libpq++/pgconnection.h: No such file or directory
../libpq++.h:28:32: libpq++/pgdatabase.h: No such file or directory
../libpq++.h:29:31: libpq++/pglobject.h: No such file or directory
../libpq++.h:30:31: libpq++/pgtransdb.h: No such file or directory
../libpq++.h:31:32: libpq++/pgcursordb.h: No such file or directory
make: *** [testlibpq0] Error 1
The second set of errors is after I manually copy the libpq++ header
file dir to /usr/local/pgsql/include/ and try to run make again. I am
not sure why but the command "make install-all-headers" did not put the
libpq++ headers into the pgsql/include. If anyone has any reasons why
this might be I would be more than happy to learn.
g++ -I/usr/local/pgsql/include -o testlibpq0 testlibpq0.cc
-L/usr/local/pgsql/lib -lpq++
In file included from ../libpq++.h:27,
from testlibpq0.cc:18:
/usr/local/pgsql/include/libpq++/pgconnection.h:85: syntax error before
`('
In file included from ../libpq++.h:29,
from testlibpq0.cc:18:
/usr/local/pgsql/include/libpq++/pglobject.h:36: syntax error before `;'
/usr/local/pgsql/include/libpq++/pglobject.h:55: syntax error before `('
In file included from ../libpq++.h:31,
from testlibpq0.cc:18:
/usr/local/pgsql/include/libpq++/pgcursordb.h:47: parse error before `&'
/usr/local/pgsql/include/libpq++/pgcursordb.h:54: parse error before `&'
/usr/local/pgsql/include/libpq++/pgcursordb.h:57: parse error before `&'
/usr/local/pgsql/include/libpq++/pgcursordb.h:60: syntax error before
`;'
/usr/local/pgsql/include/libpq++/pgcursordb.h: In method `const char
*PgCursor::Cursor () const':
/usr/local/pgsql/include/libpq++/pgcursordb.h:53: `pgCursor' undeclared
(first use this function)
/usr/local/pgsql/include/libpq++/pgcursordb.h:53: (Each undeclared
identifier is reported only once for
each function it appears in.)
/usr/local/pgsql/include/libpq++/pgcursordb.h: In method `void
PgCursor::Cursor (...)':
/usr/local/pgsql/include/libpq++/pgcursordb.h:54: `cursor' undeclared
(first use this function)
testlibpq0.cc: In function `int main ()':
testlibpq0.cc:34: `string' undeclared (first use this function)
testlibpq0.cc:34: parse error before `;'
testlibpq0.cc:40: `buf' undeclared (first use this function)
testlibpq0.cc:40: `getline' undeclared (first use this function)
I could give many more examples where I try linking in or including the
libraries by hand, etc...but it all comes out basically the same way. I
get one of two types of errors, either it cannot fine the included
header files, or it lists errors from them. That is just the libpq++. I
will now move on to my dealings with libpq, which are much the same.
This is an example when i try to make in the src/test/examples
directory.
gcc -Wl,-rpath,/usr/local/pgsql/lib testlibpq.o -o testlibpq
testlibpq.o: In function `main':
testlibpq.o(.text+0x1c): undefined reference to `PQsetdbLogin'
testlibpq.o(.text+0x28): undefined reference to `PQstatus'
testlibpq.o(.text+0x4c): undefined reference to `PQerrorMessage'
testlibpq.o(.text+0x6b): undefined reference to `PQfinish'
testlibpq.o(.text+0x8d): undefined reference to `PQexec'
testlibpq.o(.text+0x97): undefined reference to `PQresultStatus'
testlibpq.o(.text+0xb9): undefined reference to `PQclear'
testlibpq.o(.text+0xc3): undefined reference to `PQfinish'
testlibpq.o(.text+0xd8): undefined reference to `PQclear'
testlibpq.o(.text+0xe8): undefined reference to `PQexec'
testlibpq.o(.text+0xf2): undefined reference to `PQresultStatus'
testlibpq.o(.text+0x114): undefined reference to `PQclear'
testlibpq.o(.text+0x11e): undefined reference to `PQfinish'
testlibpq.o(.text+0x135): undefined reference to `PQclear'
testlibpq.o(.text+0x145): undefined reference to `PQexec'
testlibpq.o(.text+0x14f): undefined reference to `PQresultStatus'
testlibpq.o(.text+0x173): undefined reference to `PQclear'
testlibpq.o(.text+0x17d): undefined reference to `PQfinish'
testlibpq.o(.text+0x197): undefined reference to `PQnfields'
testlibpq.o(.text+0x1c8): undefined reference to `PQfname'
testlibpq.o(.text+0x1e8): undefined reference to `PQfname'
testlibpq.o(.text+0x209): undefined reference to `PQfname'
testlibpq.o(.text+0x222): undefined reference to `PQfname'
testlibpq.o(.text+0x23b): undefined reference to `PQfname'
testlibpq.o(.text+0x257): more undefined references to `PQfname' follow
testlibpq.o: In function `main':
testlibpq.o(.text+0x2b3): undefined reference to `PQgetvalue'
testlibpq.o(.text+0x2d0): undefined reference to `PQgetvalue'
testlibpq.o(.text+0x2f7): undefined reference to `PQgetvalue'
testlibpq.o(.text+0x313): undefined reference to `PQgetvalue'
testlibpq.o(.text+0x32f): undefined reference to `PQgetvalue'
testlibpq.o(.text+0x34e): more undefined references to `PQgetvalue'
follow
testlibpq.o: In function `main':
testlibpq.o(.text+0x37e): undefined reference to `PQntuples'
testlibpq.o(.text+0x392): undefined reference to `PQclear'
testlibpq.o(.text+0x3a2): undefined reference to `PQexec'
testlibpq.o(.text+0x3ac): undefined reference to `PQclear'
testlibpq.o(.text+0x3bc): undefined reference to `PQexec'
testlibpq.o(.text+0x3c6): undefined reference to `PQclear'
testlibpq.o(.text+0x3d0): undefined reference to `PQfinish'
collect2: ld returned 1 exit status
make: *** [testlibpq] Error 1
I have not actually tried to write any programs myself because I cannot
even get the example programs to compile so I do not see the point. If
anyone has any idea what might be going wrong, or what I may not be
understanding correctly I would be very grateful for your help. Even if
it turns out I'm just being stupid and missing something, I don't mind
finding that out. I just want to be able to compile programs that use
either the libpq or the libpq++.
Thanks
Isaac
From | Date | Subject | |
---|---|---|---|
Next Message | Oliver Elphick | 2002-01-30 06:52:57 | Re: libpq++ compiling errors... |
Previous Message | David Pinelo | 2002-01-29 21:41:13 | Best method of access to PostgreSql using VBA in Microsoft Access |