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

Tim Sutton suttont at onetel.net.uk
Sat Oct 25 09:05:49 UTC 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Thanks for the tips :-) After much fiddling about I resolved the problem by 
adding:

Project -> Options -> Compiler Options -> Configure Tab -> Additional Options 
- -> --with-extra-includes=/usr/include/pgsql

Most of the problem was just figuring out how kdevelop expected me to add the 
- --with-extra-includes option.

One last thing I am wondering - how would I go about adding more than one 
include path in the above example?

Cheers

Tim


On Friday 18 July 2003 16:16, lug at assursys.co.uk wrote:
> 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.

- -- 
Get my public keys from:

http://tim.suttonfamily.co.uk/modules.php?name=Content&pa=showpage&pid=2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/G5V3WvXTJUo0BDoRAnohAJ0eFv5mwef/MzOg66QZqHmDlMs2tACeIfSo
u0tJBEm8wXqYD15tYhNJeW0=
=rHdO
-----END PGP SIGNATURE-----




More information about the Sclug mailing list