public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* idl compiler for CygWin
@ 2003-08-24 18:29 Monty Wiseman
  2003-08-24 19:17 ` Problems linking c++ class libraries Mark L. Wise
  0 siblings, 1 reply; 4+ messages in thread
From: Monty Wiseman @ 2003-08-24 18:29 UTC (permalink / raw)
  To: gcc-help

I posted this several hours ago to the .general list but it hasn't appeared
and there so I am cross posting here. Is there an ILD compiler for CygWin or
Linux I can download.

-Monty



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

* Problems linking c++ class libraries
  2003-08-24 18:29 idl compiler for CygWin Monty Wiseman
@ 2003-08-24 19:17 ` Mark L. Wise
  2003-08-24 22:19   ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Mark L. Wise @ 2003-08-24 19:17 UTC (permalink / raw)
  To: gcc-help

Hello all!

I am relatively new to c++ and I have a question regarding linking class
libraries.

I have a "main line" program that calls a class out of a library (A) that I
built.  This class library also calls classes out of another library (B).
When I try to link I get an unresolved call to <the class name> class
(library B) that I call in library "A".

HOWEVER, If I include a "dummy" call in my "mainline" program to the class
in library "B", then the link from library "A" completes to library "B" and
the program runs.

Why do I have to include a reference call to the class in library "B" in my
mainline program to get it the linker to resolve the link?

Thanks in advance for any advice!!

Mark

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

* Re: Problems linking c++ class libraries
  2003-08-24 19:17 ` Problems linking c++ class libraries Mark L. Wise
@ 2003-08-24 22:19   ` Ian Lance Taylor
  2003-08-26 15:29     ` Mark L. Wise
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2003-08-24 22:19 UTC (permalink / raw)
  To: mark; +Cc: gcc-help

"Mark L. Wise" <mark@alpha2.com> writes:

> I am relatively new to c++ and I have a question regarding linking class
> libraries.
> 
> I have a "main line" program that calls a class out of a library (A) that I
> built.  This class library also calls classes out of another library (B).
> When I try to link I get an unresolved call to <the class name> class
> (library B) that I call in library "A".
> 
> HOWEVER, If I include a "dummy" call in my "mainline" program to the class
> in library "B", then the link from library "A" completes to library "B" and
> the program runs.
> 
> Why do I have to include a reference call to the class in library "B" in my
> mainline program to get it the linker to resolve the link?

Please don't send messages to this mailing list by replying to an
unrelated message.  It breaks threaded mail readers.  Thanks.

Your bug report is incomplete, because you don't say precisely what
you are doing, or what type of system you are using, or what version
of the compiler and linker you are using.

However, my guess is that you don't realize that the order in which
you mention libraries on the command line matters.  If library A
refers to library B, then you must list them in the order -lA -lB.

Ian

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

* RE: Problems linking c++ class libraries
  2003-08-24 22:19   ` Ian Lance Taylor
@ 2003-08-26 15:29     ` Mark L. Wise
  0 siblings, 0 replies; 4+ messages in thread
From: Mark L. Wise @ 2003-08-26 15:29 UTC (permalink / raw)
  To: 'Ian Lance Taylor'; +Cc: gcc-help

Ian,

Thanks for the info.  It works great now!!!

Sorry about the broken thread...  I did not know.

Let me know if I can ever help you!!

Mark

-----Original Message-----
From: Ian Lance Taylor [mailto:ian@airs.com]
Sent: Sunday, August 24, 2003 6:20 PM
To: mark@alpha2.com
Cc: gcc-help@gcc.gnu.org
Subject: Re: Problems linking c++ class libraries


"Mark L. Wise" <mark@alpha2.com> writes:

> I am relatively new to c++ and I have a question regarding linking class
> libraries.
>
> I have a "main line" program that calls a class out of a library (A) that
I
> built.  This class library also calls classes out of another library (B).
> When I try to link I get an unresolved call to <the class name> class
> (library B) that I call in library "A".
>
> HOWEVER, If I include a "dummy" call in my "mainline" program to the class
> in library "B", then the link from library "A" completes to library "B"
and
> the program runs.
>
> Why do I have to include a reference call to the class in library "B" in
my
> mainline program to get it the linker to resolve the link?

Please don't send messages to this mailing list by replying to an
unrelated message.  It breaks threaded mail readers.  Thanks.

Your bug report is incomplete, because you don't say precisely what
you are doing, or what type of system you are using, or what version
of the compiler and linker you are using.

However, my guess is that you don't realize that the order in which
you mention libraries on the command line matters.  If library A
refers to library B, then you must list them in the order -lA -lB.

Ian

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

end of thread, other threads:[~2003-08-26 15:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-24 18:29 idl compiler for CygWin Monty Wiseman
2003-08-24 19:17 ` Problems linking c++ class libraries Mark L. Wise
2003-08-24 22:19   ` Ian Lance Taylor
2003-08-26 15:29     ` Mark L. Wise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).