comp.lang.ada
 help / color / mirror / Atom feed
* There is something wrong with using libpq5 with -FdUMP-ada-spec-C ?
@ 2013-03-14 18:58 Multiplayer1080
  2013-03-14 22:21 ` Dirk Heinrichs
  2013-03-15  9:02 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 8+ messages in thread
From: Multiplayer1080 @ 2013-03-14 18:58 UTC (permalink / raw)


Hello,
I am very very new to Ada. I have dedicated to learn ada for several months and i like this language so much. But now, I need to use a database and i have a question. I hope someone can help me.

There is something wrong with using the driver debian libpq5 importing the header with $ gcc-c-FdUMP-ada-spec-C / usr / include / postgresql / libpq-fe.h?

I have seen that there is a possibility using Gnade, however it seems more difficult to use for me, since I have to build and install these tools, instead of using libraries and add them to my project. I'm in Debian 7. Sorry for my english.

M Trujillo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: There is something wrong with using libpq5 with -FdUMP-ada-spec-C ?
  2013-03-14 18:58 There is something wrong with using libpq5 with -FdUMP-ada-spec-C ? Multiplayer1080
@ 2013-03-14 22:21 ` Dirk Heinrichs
  2013-03-15 19:05   ` Multiplayer1080
  2013-03-15 19:19   ` Multiplayer1080
  2013-03-15  9:02 ` Dmitry A. Kazakov
  1 sibling, 2 replies; 8+ messages in thread
From: Dirk Heinrichs @ 2013-03-14 22:21 UTC (permalink / raw)


Multiplayer1080 wrote:

> I have seen that there is a possibility using Gnade, however it seems more
> difficult to use for me, since I have to build and install these tools,
> instead of using libraries and add them to my project. I'm in Debian 7.

On Debian, you can use APQ (libapq-postgresql3.2.0-dev) to access databases 
from Ada programs.

HTH...

	Dirk
-- 
Dirk Heinrichs <dirk.heinrichs@altum.de>
Tel: +49 (0)2471 209385 | Mobil: +49 (0)176 34473913
GPG Public Key C2E467BB | Jabber: dirk.heinrichs@altum.de




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: There is something wrong with using libpq5 with -FdUMP-ada-spec-C ?
  2013-03-14 18:58 There is something wrong with using libpq5 with -FdUMP-ada-spec-C ? Multiplayer1080
  2013-03-14 22:21 ` Dirk Heinrichs
@ 2013-03-15  9:02 ` Dmitry A. Kazakov
  1 sibling, 0 replies; 8+ messages in thread
From: Dmitry A. Kazakov @ 2013-03-15  9:02 UTC (permalink / raw)


On Thu, 14 Mar 2013 11:58:15 -0700 (PDT), Multiplayer1080 wrote:

> I have seen that there is a possibility using Gnade, however it seems more
> difficult to use for me, since I have to build and install these tools,
> instead of using libraries and add them to my project. I'm in Debian

You can use ODBC to access a PostgreSQL DB. PostgreSQL fully supports ODBC.
For Ada ODBC bindings see

http://www.dmitry-kazakov.de/ada/components.htm#ODBC_Bindings

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: There is something wrong with using libpq5 with -FdUMP-ada-spec-C ?
  2013-03-14 22:21 ` Dirk Heinrichs
@ 2013-03-15 19:05   ` Multiplayer1080
  2013-03-15 19:19   ` Multiplayer1080
  1 sibling, 0 replies; 8+ messages in thread
From: Multiplayer1080 @ 2013-03-15 19:05 UTC (permalink / raw)


El jueves, 14 de marzo de 2013 17:51:08 UTC-4:30, Dirk Heinrichs  escribió:
> Multiplayer1080 wrote:
> 
> 
> 
> > I have seen that there is a possibility using Gnade, however it seems more
> 
> > difficult to use for me, since I have to build and install these tools,
> 
> > instead of using libraries and add them to my project. I'm in Debian 7.
> 
> 
> 
> On Debian, you can use APQ (libapq-postgresql3.2.0-dev) to access databases 
> 
> from Ada programs.
> 
> 
> 
> HTH...
> 
> 
> 
> 	Dirk
> 
> -- 
> 
> Dirk Heinrichs <dirk.heinrichs@altum.de>
> 
> Tel: +49 (0)2471 209385 | Mobil: +49 (0)176 34473913
> 
> GPG Public Key C2E467BB | Jabber: dirk.heinrichs@altum.de


Thank you so much, Im trying to use that, but when i build my project with:
"for Source_Dirs use ("src", "../../../../usr/share/ada/adainclude/**");"

i have this answer:
/home/Ada-Project/testing/obj/apq-postgresql-client.o: In function `apq__postgresql__client__connect':
apq-postgresql-client.adb:(.text+0x2ce3): undefined reference to `notice_install'
/home/Ada-Project/testing/obj/apq-postgresql-client.o: In function `apq__postgresql__client__disconnect':
apq-postgresql-client.adb:(.text+0x39fe): undefined reference to `notice_uninstall'
collect2: ld returned 1 exit status
gprbuild: link of nucleo.adb failed

Do you know why i got this error? is this the correct form to include the library lapq? Im using the GPS with no switches... 

Thanks again..



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: There is something wrong with using libpq5 with -FdUMP-ada-spec-C ?
  2013-03-14 22:21 ` Dirk Heinrichs
  2013-03-15 19:05   ` Multiplayer1080
@ 2013-03-15 19:19   ` Multiplayer1080
  2013-03-16  2:50     ` Multiplayer1080
  1 sibling, 1 reply; 8+ messages in thread
From: Multiplayer1080 @ 2013-03-15 19:19 UTC (permalink / raw)


I found the problem. 

1) I have not configured the project properties > languages to C. 

2) The source /usr/share/ada/adainclude/notices.c has:
#include "libpq-fe.h"
And i change it for:
#include "postgresql/libpq-fe.h"

and with this, the building is complete normally.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: There is something wrong with using libpq5 with -FdUMP-ada-spec-C ?
  2013-03-15 19:19   ` Multiplayer1080
@ 2013-03-16  2:50     ` Multiplayer1080
  2013-03-16  9:13       ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: Multiplayer1080 @ 2013-03-16  2:50 UTC (permalink / raw)


however, i dont think that this is the best method to use a library that is in debian repository and i installed. i mean, why i have to extract the apq directory (the .ads and .adb) and rebuild it instead use a "with and use" directly?
(i guess that my novice mind dont let me use the debian advantages)



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: There is something wrong with using libpq5 with -FdUMP-ada-spec-C ?
  2013-03-16  2:50     ` Multiplayer1080
@ 2013-03-16  9:13       ` Simon Wright
  2013-03-16 21:40         ` Multiplayer1080
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2013-03-16  9:13 UTC (permalink / raw)


Multiplayer1080 <marlontrujillo1080@gmail.com> writes:

> however, i dont think that this is the best method to use a library
> that is in debian repository and i installed. i mean, why i have to
> extract the apq directory (the .ads and .adb) and rebuild it instead
> use a "with and use" directly?
> (i guess that my novice mind dont let me use the debian advantages)

You need to be using the GNAT Project facility.

I wrote a little bit about it at [1] (there must be a beginner-oriented
tutorial somewhere?)

The installed APQ library contains an "apq.gpr", in the place where GNAT
expects to find it, which tells GNAT how to compile against and link
with the software.

Write your own .gpr and include the line
   with "apq";
at the beginning.

[1] http://stackoverflow.com/questions/12582796/get-ada-compiled-with-gnat-to-import-files-from-outside-current-directory/12587981#12587981



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: There is something wrong with using libpq5 with -FdUMP-ada-spec-C ?
  2013-03-16  9:13       ` Simon Wright
@ 2013-03-16 21:40         ` Multiplayer1080
  0 siblings, 0 replies; 8+ messages in thread
From: Multiplayer1080 @ 2013-03-16 21:40 UTC (permalink / raw)


I had not installed ada, i had the GNAT GPL version (thats was the problem). 
Also, there is full information about that in the Gnat User Guide (my fault)... so : SOLVED

I was confused :( 
thank you so much for your time!



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-03-16 21:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-14 18:58 There is something wrong with using libpq5 with -FdUMP-ada-spec-C ? Multiplayer1080
2013-03-14 22:21 ` Dirk Heinrichs
2013-03-15 19:05   ` Multiplayer1080
2013-03-15 19:19   ` Multiplayer1080
2013-03-16  2:50     ` Multiplayer1080
2013-03-16  9:13       ` Simon Wright
2013-03-16 21:40         ` Multiplayer1080
2013-03-15  9:02 ` Dmitry A. Kazakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox