Search Postgresql Archives

Re: postgresql and C++/C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've just modified the extension with .c instead of .cpp and run:
vicbsd# gcc -I /usr/local/include/ prova.c -o prova -Lpq
/var/tmp//cc86RZZl.o(.text+0x25): In function `main':
: undefined 
reference to `PQconnectdb'
 
Nothing seems to be changed!

Thanks 
anyway.
Vittorio
----Messaggio originale----
Da: kleptog@xxxxxxxxx
Data: 28-set-2005 11.44
A: "vdm.fbsd@xxxxxxxxxxx"<vdm.fbsd@xxxxxxxxxxx>
Cc: <pgsql-general@xxxxxxxxxxxxxx>
Ogg: Re:  postgresql and 
C++/C

On Wed, Sep 28, 2005 at 10:11:45AM +0100, vdm.fbsd@xxxxxxxxxxx 
wrote:
> Context:FREEBSD 5.4, postgresql 8.0.3
> 
> I'm not a C newbye 
and I'm 
> having a go at compiling my first, simple C(++) program:

1. 
If it's a C program, you should name the file .c otherwise gcc is
likely to consider it a c++ program.

2. If it's a c++ program, use g++ 
to compile and link to make sure you
get all the right libraries and 
paths.

3. Use -lpq to link to the postgresql client library. You may 
need a -L
so it looks in the right place.

Hope this helps,
-- 
Martijn 
van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> 
Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for 
someone
> else to do the other 95% so you can sue them.




---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux