comp.lang.ada
 help / color / mirror / Atom feed
* My Gnat is rusty - link error
@ 2001-08-23 21:02 Thomas Kerstan
  2001-08-23 21:27 ` Marin David Condic
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Kerstan @ 2001-08-23 21:02 UTC (permalink / raw)


I have GNAT 3.12 on a windows 95 machine. (the machine also
has GNAT 3.01a but I believe that should be irrelevant)

I am able to generate executables for the samples that are
included in the win32ada/samples directory but when I try
to compile/bind/link (using gnatmake) some code that uses
the win32.winsock binding for sockets the compile and bind
complete without errors, but the gnatlink gives
undefined reference to 'WSAStartup@8'
undefined reference to ... 
messages for all of the winsock routines.

any help would be appreciated,
thanks,

Tom
kerstan@home.com



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

* Re: My Gnat is rusty - link error
  2001-08-23 21:02 My Gnat is rusty - link error Thomas Kerstan
@ 2001-08-23 21:27 ` Marin David Condic
  2001-08-24  3:31   ` Thomas Kerstan
  2001-08-25  7:04   ` Simon Wright
  0 siblings, 2 replies; 7+ messages in thread
From: Marin David Condic @ 2001-08-23 21:27 UTC (permalink / raw)


I believe you have to specify either a linker option or put the following
pragma into your code somewhere:

    pragma Linker_Options ("-lwsock32") ;

Putting it in the code will make it harder to forget. :-)

Hope this helps.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Thomas Kerstan" <kerstan@home.com> wrote in message
news:3B8571D0.64268D43@home.com...
> I have GNAT 3.12 on a windows 95 machine. (the machine also
> has GNAT 3.01a but I believe that should be irrelevant)
>
> I am able to generate executables for the samples that are
> included in the win32ada/samples directory but when I try
> to compile/bind/link (using gnatmake) some code that uses
> the win32.winsock binding for sockets the compile and bind
> complete without errors, but the gnatlink gives
> undefined reference to 'WSAStartup@8'
> undefined reference to ...
> messages for all of the winsock routines.
>
> any help would be appreciated,
> thanks,
>
> Tom
> kerstan@home.com





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

* Re: My Gnat is rusty - link error
  2001-08-23 21:27 ` Marin David Condic
@ 2001-08-24  3:31   ` Thomas Kerstan
  2001-08-25  7:04   ` Simon Wright
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Kerstan @ 2001-08-24  3:31 UTC (permalink / raw)


Marin David Condic wrote:
> 
> I believe you have to specify either a linker option or put the following
> pragma into your code somewhere:
> 
>     pragma Linker_Options ("-lwsock32") ;
> 
> Putting it in the code will make it harder to forget. :-)
> 
> Hope this helps.
> 
> MDC
> --

That did the trick,
thanks,

Tom
kerstan@home.com



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

* Re: My Gnat is rusty - link error
  2001-08-23 21:27 ` Marin David Condic
  2001-08-24  3:31   ` Thomas Kerstan
@ 2001-08-25  7:04   ` Simon Wright
  2001-08-27 14:04     ` Marin David Condic
  1 sibling, 1 reply; 7+ messages in thread
From: Simon Wright @ 2001-08-25  7:04 UTC (permalink / raw)


"Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org> writes:

> I believe you have to specify either a linker option or put the following
> pragma into your code somewhere:
> 
>     pragma Linker_Options ("-lwsock32") ;
> 
> Putting it in the code will make it harder to forget. :-)

Of course, it also binds your code to Windows .. umm, perhaps that
won't matter until 3.14p comes out? (with GNAT.Sockets)



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

* Re: My Gnat is rusty - link error
  2001-08-25  7:04   ` Simon Wright
@ 2001-08-27 14:04     ` Marin David Condic
  2001-08-27 16:45       ` David C. Hoos
  2001-08-27 18:46       ` tmoran
  0 siblings, 2 replies; 7+ messages in thread
From: Marin David Condic @ 2001-08-27 14:04 UTC (permalink / raw)


I don't think so - not any worse than using WinSock is going to bind you to
Windows anyway. Remember that a pragma that isn't recognized by another
implementation is just going to get ignored anyway - so hopefully it would
just get dropped on the floor.

My advice would be to code up a package to do all of the usual sockets jobs,
only at an Ada level of abstraction - hiding in the implementation beneath
any of the WinSock specifics. The pragma should be isolated in this part of
the code as well. From there, if you have to switch to a different flavor of
sockets, at least its all in one isolated place with a minimal level of
fuss.

Using GNAT.Sockets might be a wonderful thing - except that now your code is
GNAT dependent. This may not be bad depending on your project. Many projects
are committed to a specific compiler. However, I think a *cleaner* idea
would be for there to be some sort of Sockets support in a generalized Ada
package (descending from Ada-dot-something?) that was reasonably standard
across all implementations. Its technically doable - just a political
question. Do the vendors want to standardize this and if so at what level?
But this raises the whole "Standard Ada Library" question again.....

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Simon Wright" <simon@pushface.org> wrote in message
news:x7vheuwk4d1.fsf@smaug.pushface.org...
> "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org> writes:
>
> > I believe you have to specify either a linker option or put the
following
> > pragma into your code somewhere:
> >
> >     pragma Linker_Options ("-lwsock32") ;
> >
> > Putting it in the code will make it harder to forget. :-)
>
> Of course, it also binds your code to Windows .. umm, perhaps that
> won't matter until 3.14p comes out? (with GNAT.Sockets)





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

* Re: My Gnat is rusty - link error
  2001-08-27 14:04     ` Marin David Condic
@ 2001-08-27 16:45       ` David C. Hoos
  2001-08-27 18:46       ` tmoran
  1 sibling, 0 replies; 7+ messages in thread
From: David C. Hoos @ 2001-08-27 16:45 UTC (permalink / raw)
  To: comp.lang.ada; +Cc: marin.condic


----- Original Message -----
From: "Marin David Condic ]" <dont.bother.mcondic.auntie.spam@[acm.org>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Monday, August 27, 2001 9:04 AM
Subject: Re: My Gnat is rusty - link error


> I don't think so - not any worse than using WinSock is going to bind you
to
> Windows anyway. Remember that a pragma that isn't recognized by another
> implementation is just going to get ignored anyway - so hopefully it would
> just get dropped on the floor.
>
The pragma Linker_Options will be recognized by all compilers,
and the liker will complain when it cant find the library file.





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

* Re: My Gnat is rusty - link error
  2001-08-27 14:04     ` Marin David Condic
  2001-08-27 16:45       ` David C. Hoos
@ 2001-08-27 18:46       ` tmoran
  1 sibling, 0 replies; 7+ messages in thread
From: tmoran @ 2001-08-27 18:46 UTC (permalink / raw)


>Using GNAT.Sockets might be a wonderful thing - except that now your code is
>GNAT dependent. This may not be bad depending on your project. Many projects
>are committed to a specific compiler. However, I think a *cleaner* idea
>would be for there to be some sort of Sockets support in a generalized Ada
>package (descending from Ada-dot-something?) that was reasonably standard
>across all implementations. Its technically doable - just a political
>question. Do the vendors want to standardize this and if so at what level?
>But this raises the whole "Standard Ada Library" question again.....
  I'd modestly offer the Claw.Sockets interface (see www.rrsoftware.com).
It works on multiple compilers targetted to Windows, and the actual
Windows dependencies are inside the implementation, mostly concerning
asynchronous stuff that uses the Windows message loop.  An example very
simple web server (ca 400 lines) using it is on www.adapower.com



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

end of thread, other threads:[~2001-08-27 18:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-23 21:02 My Gnat is rusty - link error Thomas Kerstan
2001-08-23 21:27 ` Marin David Condic
2001-08-24  3:31   ` Thomas Kerstan
2001-08-25  7:04   ` Simon Wright
2001-08-27 14:04     ` Marin David Condic
2001-08-27 16:45       ` David C. Hoos
2001-08-27 18:46       ` tmoran

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