libpq++ compiling errors... - Mailing list pgsql-interfaces
From | isaac flemmin |
---|---|
Subject | libpq++ compiling errors... |
Date | |
Msg-id | 000001c1a928$7bfe8bb0$dcad2204@ixic Whole thread Raw |
Responses |
Re: libpq++ compiling errors...
Re: libpq++ compiling errors... |
List | pgsql-interfaces |
<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Hello again,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Okay, now that I have some time to concentrate on getting programs using the libpq and/or libpq++ to compileI 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 compilea program that uses the libpq or the libpq++ headers or libraries i get errors. When I installed PostgreSQL i usedboth make install, and make install-all-headers to ensure that all the header files were copied to the system and I didboth the commands as root. I have included some of the output I get when I try compiling different ways.</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">The first example is when I try to run make in the libpq++/examples directory.</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">PWD = /home/tech/isaac/postgres/postgresql-7.1.3/src/interfaces/libpq++/examples</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">g++ -I/usr/local/pgsql/include -o testlibpq0 testlibpq0.cc -L/usr/local/pgsql/lib -lpq++</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">In file included from testlibpq0.cc:18:</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial">../libpq++.h:27:34: libpq++/pgconnection.h: No such file or directory</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">../libpq++.h:28:32: libpq++/pgdatabase.h: No such file or directory</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">../libpq++.h:29:31: libpq++/pglobject.h: No such file or directory</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">../libpq++.h:30:31: libpq++/pgtransdb.h: No such file or directory</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">../libpq++.h:31:32: libpq++/pgcursordb.h: No such file or directory</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">make: *** [testlibpq0] Error 1</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">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 notput the libpq++ headers into the pgsql/include. If anyone has any reasons why this might be I would be more than happyto learn.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">g++ -I/usr/local/pgsql/include -o testlibpq0 testlibpq0.cc -L/usr/local/pgsql/lib -lpq++</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">In file included from ../libpq++.h:27,</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> from testlibpq0.cc:18:</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pgconnection.h:85: syntax error before `('</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">In file included from ../libpq++.h:29,</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> from testlibpq0.cc:18:</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pglobject.h:36: syntax error before `;'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pglobject.h:55: syntax error before `('</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">In file included from ../libpq++.h:31,</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial"> from testlibpq0.cc:18:</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pgcursordb.h:47: parse error before `&'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pgcursordb.h:54: parse error before `&'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pgcursordb.h:57: parse error before `&'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pgcursordb.h:60: syntax error before `;'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pgcursordb.h: In method `const char *PgCursor::Cursor () const':</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pgcursordb.h:53: `pgCursor' undeclared (first use this function)</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pgcursordb.h:53: (Each undeclared identifier is reported only once for</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">each function it appears in.)</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pgcursordb.h: In method `void PgCursor::Cursor (...)':</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">/usr/local/pgsql/include/libpq++/pgcursordb.h:54: `cursor' undeclared (first use this function)</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq0.cc: In function `int main ()':</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial">testlibpq0.cc:34: `string' undeclared (first use this function)</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq0.cc:34: parse error before `;'</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial">testlibpq0.cc:40: `buf' undeclared (first use this function)</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq0.cc:40: `getline' undeclared (first use this function)</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">I could give many more examples where I try linking in or including the libraries by hand, etc...but itall 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 muchthe same.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">This is an example when i try to make in the src/test/examples directory.</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">gcc -Wl,-rpath,/usr/local/pgsql/lib testlibpq.o -o testlibpq</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o: In function `main':</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x1c): undefined reference to `PQsetdbLogin'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x28): undefined reference to `PQstatus'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x4c): undefined reference to `PQerrorMessage'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x6b): undefined reference to `PQfinish'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x8d): undefined reference to `PQexec'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x97): undefined reference to `PQresultStatus'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0xb9): undefined reference to `PQclear'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0xc3): undefined reference to `PQfinish'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0xd8): undefined reference to `PQclear'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0xe8): undefined reference to `PQexec'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0xf2): undefined reference to `PQresultStatus'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x114): undefined reference to `PQclear'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x11e): undefined reference to `PQfinish'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x135): undefined reference to `PQclear'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x145): undefined reference to `PQexec'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x14f): undefined reference to `PQresultStatus'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x173): undefined reference to `PQclear'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x17d): undefined reference to `PQfinish'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x197): undefined reference to `PQnfields'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x1c8): undefined reference to `PQfname'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x1e8): undefined reference to `PQfname'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x209): undefined reference to `PQfname'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x222): undefined reference to `PQfname'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x23b): undefined reference to `PQfname'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x257): more undefined references to `PQfname' follow</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o: In function `main':</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x2b3): undefined reference to `PQgetvalue'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x2d0): undefined reference to `PQgetvalue'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x2f7): undefined reference to `PQgetvalue'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x313): undefined reference to `PQgetvalue'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x32f): undefined reference to `PQgetvalue'</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x34e): more undefined references to `PQgetvalue' follow</span></font><p class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o: In function `main':</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x37e): undefined reference to `PQntuples'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x392): undefined reference to `PQclear'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x3a2): undefined reference to `PQexec'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x3ac): undefined reference to `PQclear'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x3bc): undefined reference to `PQexec'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x3c6): undefined reference to `PQclear'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">testlibpq.o(.text+0x3d0): undefined reference to `PQfinish'</span></font><p class="MsoNormal"><font face="Arial"size="2"><span style="font-size:10.0pt; font-family:Arial">collect2: ld returned 1 exit status</span></font><p class="MsoNormal"><font face="Arial" size="2"><spanstyle="font-size:10.0pt; font-family:Arial">make: *** [testlibpq] Error 1</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">I have not actually tried to write any programs myself because I cannot even get the example programsto compile so I do not see the point. If anyone has any idea what might be going wrong, or what I may not be understandingcorrectly 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++.</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Thanks</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; font-family:Arial">Isaac</span></font></div>
pgsql-interfaces by date: