linking libraries

W. Tasin Walter.Tasin at t-online.de
Wed Mar 21 23:46:42 GMT 2001


Jake Skinner wrote:

Hi,

I was adding -lpq++ to
Project->Options->Linker options-> Add. libs.

-L/usr/local/pgsql/lib to
Project->Options->Linker options-> linker flags.

and -I/usr/local/pgsql/include
Project->Options->Compiler options-> additional options

and it works fine (only inside KDevelop of course, not for distributions 
or commandline configure).

> adding -lpq++ to the linker options doesn't make any difference :(
> 
>  
> 
> the error occurs when Kdevelop checks the environment.
> 
>     checking whether the C compiler (gcc -O1 -I/usr/include/pgsql 
> -lpq++)works ..... no
> 
>     C compiler cannot create executables
> 

this seems strange to me...
flags of the C compiler???

It has to be a C++ flag, where -lpq++ should be added (and not inside configure process).

---
So what happens if you are creating a new c++ project adding the flags as described above:
My configure says to me:
...
checking for working makeinfo... found
checking for gcc... (cached) gcc
checking whether the C compiler (gcc -O0 -g3 -Wall -I/usr/local/pgsql/include  -L/usr/local/pgsql/lib) works... yes
checking whether the C compiler (gcc -O0 -g3 -Wall -I/usr/local/pgsql/include  -L/usr/local/pgsql/lib) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for c++... (cached) c++
checking whether the C++ compiler (c++ -O0 -g3 -Wall -I/usr/local/pgsql/include  -L/usr/local/pgsql/lib) works... yes
checking whether the C++ compiler (c++ -O0 -g3 -Wall -I/usr/local/pgsql/include  -L/usr/local/pgsql/lib) is a cross-compiler... no
checking whether we are using GNU C++... (cached) yes
checking whether c++ accepts -g... (cached) yes
checking for ranlib... (cached) ranlib
...

so NO -lpq++ inside configure checking for compilers.

I haven't these pathes on my system, but it does no harm to the system either.

Only make shows the additional library "-lpq++":

make[3]: Leaving directory `/home/tasin/testpqpp/testpqpp/docs'
make[3]: Entering directory `/home/tasin/testpqpp/testpqpp'
c++ -DHAVE_CONFIG_H -I. -I. -I..   -I/usr/local/pgsql/include  -L/usr/local/pgsql/lib -c main.cpp
c++  -L/usr/local/pgsql/lib  -o testpqpp  main.o -lpq++
make[3]: Leaving directory `/home/tasin/testpqpp/testpqpp'
make[2]: Leaving directory `/home/tasin/testpqpp/testpqpp'
make[2]: Entering directory `/home/tasin/testpqpp'


Ciao

Walter
>  
> 
>  
> 
>  
> 
> the lib path is in ld.so.conf :(
> 
>  
> 
> I'm stumped!?
> 
> jake
> 
>  
> 
>  
> 
>     -----Original Message-----
>     *From:* Mailing list agent [mailto:mdom at barney.cs.uni-potsdam.de]*On
>     Behalf Of *Pascal A. Niklaus
>     *Sent:* Monday, 19 March 2001 4:27 PM
>     *To:* kdevelop at kdevelop.org
>     *Subject:* Re: linking libraries
>     
>     Just add -lpq++ to the linker options (under Projects->Option in
>     KDevelop 1.4), and also include the path -L/... in the options or
>     alternatively include it in /etc/ld.so.conf and don't forget to run
>     ldconfig... That should work
>     
>     Pascal
>     
>     
>     At 04:45 PM 19/03/2001, you wrote:
>     
>>     I am having trouble linking external libraries - specifically
>>     postgresql
>>     libraries.
>>     
>>     I can get everything working on the command line, but not within the
>>     Kdevelop IDE.
>>     
>>     This is what I type at the command line
>>     
>>             g++ -I/usr/local/pgsql/include -o myapp
>>     myapp.cpp -L/usr/local/pgsql/lib -lpq++
>>     
>>     which works as desired, but in the Kdevelop IDE it throws up
>>     comilation
>>     errors. ie can't find the libraries.
>>     
>>     Any suggestions would be great. I know it is something simple but
>>     hey :)
>>     
>>     Thanks
>>     Jake
>     
>     
>     ________________________________________________________
>     
>     Present address:
>     
>     Pascal Niklaus
>     Landcare Research
>     Private Bag 11 052
>     Palmerston North
>     New Zealand                       
>     
>     Phone: +64 6 356 7154 (reception)
>            +64 6 350 5799 3968 (direct)
>     Fax:   +64 6 355 9230
>     
>     e-mail: Pascal.Niklaus at unibas.ch <mailto:Pascal.Niklaus at unibas.ch>
>     or Pascal.Niklaus at gmx.ch <mailto:Pascal.Niklaus at gmx.ch>
>     _________________________________________________________



-- 
-- 
The KDevelop project: tasin at kdevelop.de [www.kdevelop.org]
--
oohhh sveglia.... il mondo e' ammalato, ma x colpa di chi.........
(Zucchero)
:-------W. Tasin, FB 
04,FHM-------------------PGP-KeyID:0x7961A645----------:
<Key-Fingerprint: 1610 835F 0080 32F4 6140  6CF7 A7D0 44CD 7961A645>



-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list