Adding Boost makes the debug build depend on the run-in-non-D MSVC DLLs

I have an annoying problem that I could somehow get around, but, on the other hand, I’m most likely to be on top and understand what exactly is happening, as it seems that this material is really here to stay.

Here's a story: I have a simple OpenGL application that works great: there is never a problem in compiling, linking, or starting up. Now I decided to try moving some of the more computationally intensive workflows to possibly make the GUI even more responsive - using Boost.Thread, of course.

In short, if I add the following snippet to the top of my .cpp file:

#include <boost/thread/thread.hpp>

void dummyThreadFun() { while (1); }    

boost::thread p(dummyThreadFun);

then I start getting "This application could not start because MSVCP90.dll was not found" when I try to start the Debug assembly. (Release mode works fine.)

Now, looking at the executable using Dependency Walker, which also does not find this DLL (which I believe is expected), I could see that we were looking for it in order to be able to call the following functions:

?max@?$numeric_limits@K@std@@SAKXZ
?max@?$numeric_limits@_J@std@@SA_JXZ
?min@?$numeric_limits@K@std@@SAKXZ
?min@?$numeric_limits@_J@std@@SA_JXZ

Next, I tried to convert each instance minand maxinstead of using macros, but I probably could not find all the links to them, as this did not help. (I use some external libraries for which I don’t have source code. But even if I could do this, I don’t think it really is.)

So my questions - I think, are:

  • Why are we not looking for a debugging DLL, although we are working with a debug build?
  • ? -?

Visual Studio 2008. Feature Pack SP1, . , .

Boost (v1.36.0). , Boost , , , .

. , OpenGL, - ( MSVCR90.dll _mkdir, boost::create_directory, !!). , .

, Side-by-Side ( , , , ), , , - , , ...


1: , , , Spread Toolkit, , , . ( , , Boost.)

, . : A.cpp B.cpp.

a.cpp:

#include "sp.h"

int main(int argc, char* argv[])
{
    mailbox mbox = -1;
    SP_join(mbox, "foo");

    return 0;
}

B.cpp:

#include <boost/filesystem.hpp>

:

  • SP_join A.cpp, .
  • B.cpp, .
  • B.cpp A.cpp, .

( 2 3 SP_join, , ... .)

, Spread , , №1, .

-, . ( , ...)


2: , , WinXP32 + VS2008 + Boost 1.36.0 ( BoostPro Computing).

, , Spread lib, - STLPort MSVC 6! , . , , , 1-3 . , .

, Boost.Thread, Boost Filesystem. , MSVCR90.dll, P .

+5
6

Boost.Thread , MSVC. -, Boost.Thread Boost.Thread DLL. DLL- MSVC . , .

Boost.Thread , , . , , _DEBUG. /MD /MDd, , .

? .lib ?

+2

. , DLL Boost, ++ ( , "" ). boost::posix::time, DLL.

, , Boost ( email, , , BOOST_THREAD_USE_DLL BOOST_THREAD_USE_LIB).


, , . DLL, , TR1 ( ). - Microsoft. . -, boost::posix::time ++.

, , , , Boost . , , : BJam Boost Build script . .

+1

, Boost . , , Boost lib. , "-" .

, , BOOST_ALL_NO_LIB ( "" ), VC .

+1

, Boost. MSVC, .

4 C ( ++):

  • /MT: libcmt.lib(C), libcpmt.lib(++)
  • /MTd: libcmtd.lib, libcpmtd.lib
  • /MD: msvcrt.lib, msvcprt.lib
  • /MDd: msvcrtd.lib, msvcprtd.lib

DLL - lib ( - DLL - ). , d. C c, ++ cp. . ? .

( ) , , C ++ ( #pragma comment(lib)). , , PITA . " " - /nodefaultlib:..., 6 C ++, , , . , , ... , - , , "" .

+1

... - :

boost::posix_time::ptime pt = boost::posix_time::microsec_clock::universal_time();

( #include), . , , , , ?

0

boost , . , BOOST_THREAD_USE_DLL ..

BOOST_THREAD_USE_DLL , , _DEBUG - . ++, BOOST_XYZ, Visual Studio ( makefile)

Check the file config.hppin the accelerated stream directory. When you draw in material ptime, it may include another file config.hpp, which can then define these preprocessor functions in different ways.

0
source

All Articles