Possible Error (with Fix?) in debug build of thread(?) library created with msvc/stlport.

As a newbie I'd like to say a big thank to all those concerned for boost. I found that the following (MSVC6) program fails when in the (default) debug build, but works in release: #include <iostream> #include <boost/thread/thread.hpp> int main(int , char* ) { int NUM_CLIENTS = 3; boost::thread_group thrds; std::cout << NUM_CLIENTS; // prints 0 in _DEBUG build, 3 in release return 0; } It was linked using the libboost_thread.lib file created using the following bjam command: bjam "-sTOOLS=msvc-stlport" "-sSTLPORT_PATH=F:\TemplateStuff" "-sBUILD=debug <runtime-link>static <stlport-iostream>on" POSSIBLE FIX Compiling the above program with _STLP_DEBUG defined gives the correct answer. Is this the correct fix to the problem? (I've noted that there is no mention of _STLP_DEBUG in the distributed docs) Mike Wilson Thanks again to the boost community.

As a newbie I'd like to say a big thank to all those concerned for boost.
What do mean by failed? Doesn't compile? Link? or Run? If it doesn't link it's probably because the debug version of boost.threads will be built with _STLP_DEBUG with that toolset, so yes that may be the fix. John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm

What do mean by failed? Doesn't compile? Link? or Run?
Answer. It Compiles(even when the arg list is wrong!) ,Links & Runs but outputs 0 instead of 3. It links with the following warning LINK : warning LNK4098: defaultlib "LIBCMT" conflicts.... but this warning can be remove in one of two ways. 1. Comment out the <iostream> header & std::cout call Stepping through the code you can see that NUM_CLIENTS is 0 2. Using the "ignore LIBCMT" link setting SUGGESTION Perhaps the build of all the boost with stlport libraries just use the settings defined in stl_user_config.h The default installation of stlport 4.5.3 for _STLP_PORT is as follows: // #define _STLP_DEBUG 1
participants (3)
-
John Maddock
-
Mike Wilson
-
Mike Wilson