[sclug] C++ Linking to libpg++ problem

lug at assursys.co.uk lug at assursys.co.uk
Sat Oct 25 09:05:49 UTC 2003


On Fri, 18 Jul 2003, Tim Sutton wrote:

> Hi All
> 
> I am using kdevelop for my C++ learning exploits. I am trying to incorporate 
> some code written by a third party into my app, but I am having compilation 
> problems. The class relies on libpg++ (postgresql c++ interface), which I 
> have installed from rpm on my mandrake box. The headers live under 
> /usr/include/pgsql/. I presume I need to add a -I/usr/include/pgsql/ to the 
> configure process, but cant find the right place to do this within the 
> kdevelop ide. 

Or use:

#include <pgsql/foo.h>

/usr/include is normally in the standard include path (which is implied by
the use of < and > instead of ").

> Is my presumption correct?
> Does anyone know where the correct place to do this within kdevelop is?

Alternatively, you could hack the compiler command in Options->KDevelop
Setup->Compiler. Personally, I think it's better to have a sane Makefile
(extra brownie points for using autoconf etc. if you can figure it all out).

> Is the -l in  -I/usr/include/pgsql/ a small 'L' or a capital 'i'?

Hmmm... Sounds like you need a better font! (The Bitstream Vera series are
nice).

-I (capital 'i') is used to add a directory to the search path for header
files. -L (capital 'ell') is used to add a directory to the search path for
libraries. -lxxx (lowercase 'ell') is used to specify that a library named
libxxx.so or libxxx.a should be linked with the object files when producing
the binary.

> Many thanks
> Tim Sutton
> BDWorld Middleware Programmer

Best Regards,
Alex.
-- 
Alex Butcher      Brainbench MVP for Internet Security: www.brainbench.com
Bristol, UK                      Need reliable and secure network systems?
PGP/GnuPG ID:0x271fd950                         <http://www.assursys.com/>



More information about the Sclug mailing list