Boost logo

Boost Users :

Subject: Re: [Boost-users] Including a source library with Boost.Build
From: Ryan Gallagher (ryan.gallagher_at_[hidden])
Date: 2009-03-03 18:44:51


Z. S. O. <tiredashell <at> gmail.com> writes:

>
> I'm not sure what that means. I've already #included the header files
> in the main cpp file, and it sounds like you're saying I need to list
> the cpp files i'm using somewhere...
>
> On 3/3/09, Steven Watanabe <watanabesj <at> gmail.com> wrote:
> > AMDG
> >
> > Z. S. O. wrote:
> >> Do you mean linking them in the jamfile? I'm not sure how to do that
> >> -- I think this is what's causing me problems.
> >
> > You need to list them as sources.
> >
> >> On Tue, Mar 3, 2009 at 5:00 PM, Steven Watanabe <watanabesj <at> gmail.com
> >> <mailto:watanabesj <at> gmail.com>> wrote:
> >>
> >> AMDG
> >>
> >>
> >> Z. S. O. wrote:
> >>
> >> I have a source library I'd like to include in my Boost.Build
> >> project. The library consists of an assortment of header and
> >> cpp files in a folder next to the main cpp file and jamfile.
> >> It doesn't require any elaborate precompilation, so it should
> >> work just by #including the appropriate header files in the
> >> main cpp file (i.e., #include "FolderName/FileName.h").
> >>
> >> My question is, do I need to do anything other than that to
> >> make this work? I'm getting an "undefined symbols" error, so
> >> clearly Boost.Build not finding something correctly.
> >>
> >>
> >> As long as you're linking all the cpp files that you need, it
> >> should work.
> >>
> >
> > _______________________________________________
> > Boost-users mailing list
> > Boost-users <at> lists.boost.org
> > http://lists.boost.org/mailman/listinfo.cgi/boost-users
> >
>

I think he's suggesting to just add the .cpp files as sources from
this library that you need to your BBv2 exe target just as you do
your main.cpp file. e.g.

<BBv2>
exe my_exec : main.cpp ../library/a.cpp ../library/b.cpp ;

This is a very simple way to do it. If you need everything in that
library then you might just use [ glob ], otherwise create a
variable to hold these files. Better yet, just make a jamfile for
building a library binary. I suggest you look at the following:

http://www.boost.org/doc/tools/build/doc/html/bbv2/tasks.html#bbv2.tasks.progra
ms

http://www.boost.org/doc/tools/build/doc/html/bbv2/tasks/libraries.html

http://www.boost.org/doc/tools/build/doc/html/bbv2/reference/rules.html

HTH,

-Ryan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net