Boost logo

Boost Users :

From: Mike Wilson (yg-boost-users_at_[hidden])
Date: 2002-11-09 10:38:50


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.


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