Compile Boost.thread libraries has a static library (.lib) with msvc 6 ?
Hi everyone, I'm a total newbie to boost, but I've got to developp a project that could use some of the powerful boost libraries, so I'm trying to make a move in that way... Ok, most of the boost libraries I can build in a static way and create (.lib) files with Microsoft Visual Studio 6.0 for my partners to use . But I am having a problem doing the same thing with the Boost.Thread libraries... First question : Is it possible to build this librairy in a (.lib) file with msvc 6.0? I'm getting tons of warnings concerning "dllexport" problems, but the (.lib) are still created. I was wondering if someone could help me understanding/fixing the warning problems : warning C4275: non dll-interface class 'boost::noncopyable' used as base for dll-interface class 'boost::detail::condition_impl' c:\wrk\common\boost-1.30.2\boost\noncopyable.hpp(22) : see declaration of 'noncopyable' warning C4273: 'thread::thread' : inconsistent dll linkage. dllexport assumed. I really need to avoid using .dll in this project, so builing this static library is very important to me... Thanks in advance, Simon _________________________________________________________________ MSN Search, le moteur de recherche qui pense comme vous ! http://fr.ca.search.msn.com/
I've been over the documentation several times and I keep getting the feeling that I'm just missing something. I'd like to have some member functions (methods) as slots for some signals (a la QT). I suspect that there is some form of bind that I could use, but it's certainly not obvious to me. Victor A. Wagner Jr. http://rudbek.com The five most dangerous words in the English language: "There oughta be a law"
On Tuesday 30 September 2003 04:12 pm, Victor A. Wagner, Jr. wrote:
I've been over the documentation several times and I keep getting the feeling that I'm just missing something. I'd like to have some member functions (methods) as slots for some signals (a la QT). I suspect that there is some form of bind that I could use, but it's certainly not obvious to me.
Yep, bind can do it:
struct X {
int foo(float, char);
};
signal
First, thanks for the prompt reply. I was wondering about mem_fn also IMO updating the docs to reflect that would be quite useful.... I think I personal prefer mem_fn() for our application. At Tuesday 2003-09-30 13:47, you wrote:
On Tuesday 30 September 2003 04:12 pm, Victor A. Wagner, Jr. wrote:
I've been over the documentation several times and I keep getting the feeling that I'm just missing something. I'd like to have some member functions (methods) as slots for some signals (a la QT). I suspect that there is some form of bind that I could use, but it's certainly not obvious to me.
Yep, bind can do it:
struct X { int foo(float, char); };
signal
sig; sig.connect(bind(&X::foo, _1, _2, _3)); // or sig.connect(mem_fn(&X::foo)); The _1 is the implicit object parameter ("this") that the member function pointer is invoked with.
Doug
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Victor A. Wagner Jr. http://rudbek.com The five most dangerous words in the English language: "There oughta be a law"
note the additions and comments At Tuesday 2003-09-30 14:11, you wrote:
First, thanks for the prompt reply.
I was wondering about mem_fn also IMO updating the docs to reflect that would be quite useful.... I think I personal prefer mem_fn() for our application.
At Tuesday 2003-09-30 13:47, you wrote:
On Tuesday 30 September 2003 04:12 pm, Victor A. Wagner, Jr. wrote:
I've been over the documentation several times and I keep getting the feeling that I'm just missing something. I'd like to have some member functions (methods) as slots for some signals (a la QT). I suspect that there is some form of bind that I could use, but it's certainly not obvious to me.
Yep, bind can do it:
struct X { int foo(float, char);
void blah() const;
};
signal
sig; sig.connect(bind(&X::foo, _1, _2, _3));
X xt;
signal
// or sig.connect(mem_fn(&X::foo));
The _1 is the implicit object parameter ("this") that the member function pointer is invoked with.
Doug
btw, I sent you a bug report w/ msvc++7.1 and debug assertion (heap not valid) when destructing a signal
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Victor A. Wagner Jr. http://rudbek.com The five most dangerous words in the English language: "There oughta be a law" _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Victor A. Wagner Jr. http://rudbek.com The five most dangerous words in the English language: "There oughta be a law"
On Wednesday 01 October 2003 12:36 am, Victor A. Wagner, Jr. wrote:
struct X {
int foo(float, char);
void blah() const;
};
X xt;
signal
/// the above is more in line with what QT does with it's connect (i.e. binds it to an instance and method) /// now only if there were some nifty syntactic sugar we could come up with so we could: sigx.connect(magicsugar(&xt.blah)); /// which would more clearly show the intent, IMO
The bind syntax easily extends to more involved examples (e.g., reordering parameters, binding other parameters, or even nested bind expressions), whereas other, simpler syntax does not. It's somewhat of an acquired taste, but once you've really "got it" you'll never be able to go back.
btw, I sent you a bug report w/ msvc++7.1 and debug assertion (heap not valid) when destructing a signal
I see it, and will try to duplicate the problem locally. Doug
Huck finn wrote:
Hi everyone, I'm a total newbie to boost, but I've got to developp a
[snip]
I really need to avoid using .dll in this project, so builing this static library is very important to me...
Hopefully some guru will give you a detailed answer. However, in the interests of giving you something quickly: No. It has to be a DLL. It has something to do with either initialization or termination. The static libraries don't do it correctly. The DLLs do. Sorry. HTH (and a clearer answer comes along), - Mark
Mark Sizer
Huck finn wrote:
Hi everyone, I'm a total newbie to boost, but I've got to developp a
[snip]
I really need to avoid using .dll in this project, so builing this static library is very important to me...
Hopefully some guru will give you a detailed answer. However, in the interests of giving you something quickly:
No. It has to be a DLL. It has something to do with either initialization or termination.
More specifically, it has to do with TLS. If you don't need TLS support, I think it's possible to build a static version of the threads library, but it doesn't seem to be supported by the Jamfile.
The static libraries don't do it correctly. The DLLs do. Sorry.
HTH (and a clearer answer comes along), - Mark
HTH2, -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (5)
-
David Abrahams
-
Douglas Gregor
-
Huck finn
-
Mark Sizer
-
Victor A. Wagner, Jr.