comp.lang.ada
 help / color / mirror / Atom feed
* Calling GNAT Ada 95 from C
@ 1996-04-09  0:00 Vance Christiaanse
  1996-04-10  0:00 ` David Weller
  1996-04-10  0:00 ` Robert Dewar
  0 siblings, 2 replies; 3+ messages in thread
From: Vance Christiaanse @ 1996-04-09  0:00 UTC (permalink / raw)


In an earlier thread, we learned that

gnatbind -n my_ada.ali
gnatbl -linkonly my_ada.ali my_c.o

would link a C main that called Ada code in a GNAT environment.
It worked for me until I threw a task into my Ada code.  Then
I got an undefined symbol, "__priority_main" I think it was.

Is it possible with GNAT for a C main to call Ada code that
includes a task?  If so, could someone please tell me how to
do it?  Thanks in advance.  I tried several things but could
not get it to work.

Vance Christiaanse
cintech@ix.netcom.com




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

* Re: Calling GNAT Ada 95 from C
  1996-04-09  0:00 Calling GNAT Ada 95 from C Vance Christiaanse
  1996-04-10  0:00 ` David Weller
@ 1996-04-10  0:00 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Dewar @ 1996-04-10  0:00 UTC (permalink / raw)


Vance asks

"Is it possible with GNAT for a C main to call Ada code that
includes a task?  If so, could someone please tell me how to
do it?  Thanks in advance.  I tried several things but could
not get it to work."

This is a known bug (the main priority) stuff, fixed in GNAT 3.04. 
For now, you can cut and paste code from a b_xx.c file created without
the -n switch.

Please direct detailed technical questions on GNAT to report@gnat.com,
I am the only one on the GNAT team who reads CLA regularly (most members
of the GNAT team long ago decided that the signal to noise ratio was
too low to be worth it :-) So be sure to always send mail to report@gnat.com
to ensure that the most knoweldgabe person sees it.





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

* Re: Calling GNAT Ada 95 from C
  1996-04-09  0:00 Calling GNAT Ada 95 from C Vance Christiaanse
@ 1996-04-10  0:00 ` David Weller
  1996-04-10  0:00 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: David Weller @ 1996-04-10  0:00 UTC (permalink / raw)


In article <316ACAF2.5488@ix.netcom.com>,
Vance Christiaanse  <cintech@ix.netcom.com> wrote:
>I got an undefined symbol, "__priority_main" I think it was.
>
>Is it possible with GNAT for a C main to call Ada code that
>includes a task?  If so, could someone please tell me how to
>do it?  Thanks in advance.  I tried several things but could
>not get it to work.
>

Hmm, seems I've seen this problem before... :-)

In your C code, you need to add this little routine:

int __main_priority ()
{
  return -1;
}

I think this is being fixed in the next GNAT release, but Robert Dewar
told me nobody had discovered it before because nobody had yet tried
to call an Ada task from a C program.  I had asked Robert about this a
week ago, and he gave me a very prompt reply (with the code above
included :-)









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

end of thread, other threads:[~1996-04-10  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-09  0:00 Calling GNAT Ada 95 from C Vance Christiaanse
1996-04-10  0:00 ` David Weller
1996-04-10  0:00 ` Robert Dewar

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