From: Djekic Dusan <djekic.dusan@gmail.com>
To: Aseem Rastogi <aseem@india.tejasnetworks.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Compiling and Linking help
Date: Tue, 08 Nov 2005 10:40:00 -0000 [thread overview]
Message-ID: <8d192cb80511080240y3e3055e7jf07a65360b6ca18@mail.gmail.com> (raw)
In-Reply-To: <4370808B.8070607@india.tejasnetworks.com>
a.h is still being used by other developers, so unfortunately I am not
entitled to change it.
Could you suggest who might be able to give the right answer?
On 11/8/05, Aseem Rastogi <aseem@india.tejasnetworks.com> wrote:
> i would suggest rewrite a.h for better future.
>
> its not important what you get from ur predecessors but what you leave
> behind for ur successors. :)
>
> Djekic Dusan wrote:
>
> >unfortunately a.h also have some classes declarations and
> >implementations within it, and in b.h I declare pointers to some of
> >those classes.
> >
> >On 11/8/05, Aseem Rastogi <aseem@india.tejasnetworks.com> wrote:
> >
> >>may be this will works.
> >>
> >>include a.h in b.cpp and not in b.h if possible.
> >>
> >>Djekic Dusan wrote:
> >>
> >>>the previous message was a mistake, since I have not correctly the first line.
> >>>Yes, you are right about it. But, in reality, a.h includes many
> >>>functions, and including all of them is rather tedious job. Is there
> >>>any other solution?
> >>>
> >>>On 11/8/05, Aseem Rastogi <aseem@india.tejasnetworks.com> wrote:
> >>>
> >>>>do not include a.h in b.h and declate a () as an extern function in b.h
> >>>>
> >>>>include a.h in main.cpp.
> >>>>
> >>>>it should work.
> >>>>
> >>>>Djekic Dusan wrote:
> >>>>
> >>>>>a.h is not the file I could change. I am just using it from third
> >>>>>party. Files in my project are b.h, c.h, and so forth. I forgot that
> >>>>>all my .h files are enclosed within suitable #ifndef, #define, and
> >>>>>#endif. And the question is how to have .o files of all b, c, and so
> >>>>>forth files linked without having multiple definition linking error of
> >>>>>everything from a, since everything from a is defined twice:
> >>>>>1 - in b.o (since b.h includes a.h)
> >>>>>2 - in main.o (since main.cpp includes b.h which includes a.h)
> >>>>>
> >>>>>On 11/8/05, Dima Sorkin <dima.sorkin@gmail.com> wrote:
> >>>>>
> >>>>>>On 11/8/05, Djekic Dusan wrote:
> >>>>>>
> >>>>>>>a.h
> >>>>>>>int a( ) { };
> >>>>>>>
> >>>>>>Hi.
> >>>>>>I have encountered this problem too.
> >>>>>>Explicitly writing "inline int a() {}" instead
> >>>>>>of your piece of code helped.
> >>>>>>
> >>>>>>Or , if "a" will be a big function (not intended for inlining),
> >>>>>>you will have to
> >>>>>>move it's definition into a.cpp, and in a.h there will be
> >>>>>>only declaration.
> >>>>>>
> >>>>>>Regards,
> >>>>>>Dima.
> >>>>>>
> >>>>>>
> >>>>--
> >>>>The end is always good. If it's not good, it's not the end.
> >>>>
> >>>>
> >>>>
> >>>>
> >>
> >>--
> >>The end is always good. If it's not good, it's not the end.
> >>
> >>
> >>
> >>
> >
>
>
> --
> The end is always good. If it's not good, it's not the end.
>
>
>
>
next prev parent reply other threads:[~2005-11-08 10:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-08 8:31 Djekic Dusan
2005-11-08 8:43 ` Aseem Rastogi
2005-11-08 8:45 ` Dima Sorkin
2005-11-08 9:54 ` Djekic Dusan
2005-11-08 9:59 ` Aseem Rastogi
2005-11-08 10:03 ` Djekic Dusan
2005-11-08 10:10 ` Djekic Dusan
2005-11-08 10:17 ` Aseem Rastogi
2005-11-08 10:20 ` Djekic Dusan
2005-11-08 10:31 ` Aseem Rastogi
2005-11-08 10:40 ` Djekic Dusan [this message]
2005-11-08 15:11 ` John Love-Jensen
2005-11-09 11:28 ` Dima Sorkin
2005-11-09 16:07 ` corey taylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d192cb80511080240y3e3055e7jf07a65360b6ca18@mail.gmail.com \
--to=djekic.dusan@gmail.com \
--cc=aseem@india.tejasnetworks.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).