Boost logo

Boost :

From: vc (vcotirlea_at_[hidden])
Date: 2003-03-24 10:43:27


Thanks for the answer.

So, it seems that the boost.thread has to be a dll.

I've done as Dave suggested: bjam -d2 so I could made all the settings for
the dll-project
like they are done by you.

Still some problems:
1) You are using the /MD (/MDd) flag for the "Runtime Library". This is a
problem for me as
I have tons of libs (static libs) built with /MT (/MTd) so the final exe
that will use those libs but also
the boost.thread lib can not be linked.
I could set the /MT (/MTd) for the boost.thread dll also, but I'm not sure
if this is ok. Is it?
If not, what can I do?

2) I still get 48 warnings, most of them C4275. If somebody is interested I
could send
the project that I created and that generates those warnings. I'm not sure
if I can ignore them
or if there is a way to remove them?

Thanks,
Viv

----- Original Message -----
From: "William E. Kempf" <wekempf_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, March 21, 2003 7:52 PM
Subject: Re: [boost] boost 1.30 - Thread lib workspace

>
> vc said:
> > Hi all,
> >
> > I'm using the boost version 1.30 release, on Win2k and the VC7.1
> > compiler.
> >
> > I'm porting a big application from Unix to Windows. Because for all the
> > modules within this app I created
> > a VC++ workspace I would like to do the same for the thread library from
> > boost.
> >
> > For this I did the following steps:
> > 1) Create with VC7.1 a "Static library" application without "Precompiled
> > header"
> > 2) Add to this lib the source files (from boost_1_30_0\libs\thread\src):
> > 3) Set the right paths of the project for finding the includes
> > 4) Build the lib
> >
> > My questions/problems are:
> >
> > 1) Are ok the above steps that I have done? Is it ok that I created it
> > as a static lib (this is how I would
> > like to have it)?
>
> Not if you make use of thread_specific_ptr<> in any of your code. Note
> also that the next version of Boost.Threads will be doing this internally
> for boost::thread itself... so a static build won't really be possible
> with that release.
>
> > 2) Are there any preprocessor flags that I have to add to the project?
> > If yes from where can I
> > find out which should I set?
>
> Just make sure you're linking to the multi-threaded C RTL.
>
> > 3) I got a lot of warnings like: "xtime.cpp(75) : warning C4273:
> > 'boost::xtime_get' : inconsistent dll linkage". Actually there are 119
> > warnings like this one (C4273 and C4275).
> > Why do I get these warnings? Is there a way to eliminate them? Should I
> > be worried about them?
>
> You'll have to add code to $BOOST_ROOT/boost/thread/detail/config.hpp to
> not define BOOST_THREAD_DECL when building a static library.
>
> > 4) Actually I'm using the thread lib from boost, just because it seems
> > that it is used by spirit when adding the
> > "SPIRIT_THREADSAFE" flag.
> > Looking a little through the boost source files comments I saw that by
> > default the Windows native threads are used.
> > But the threads created specifically by the application are posix
> > threads so for them I used the pthread-win32 lib.
> > Can I have problems because there will be both types of threads?
>
> I wouldn't expect problems, but you can compile Boost.Threads with
> pthreads-win32 if you want (at least with this version... the next release
> probably won't work with this configuration, and I have to admit that I've
> not tested this build variant in quite a while). Look at
> $BOOST_ROOT/libs/thread/build/threads.jam to see how to do this.
>
> --
> William E. Kempf
>
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk