Boost logo

Boost Users :

From: Neil Fang (neilfang2009_at_[hidden])
Date: 2008-05-31 04:15:01


Hi

I have a win32 static library with a class like this :

typedef boost::function<void (int)> TimerCallbackType;
class TimerManager
{
public:
        int addTimer(int interval, TimerCallbackType callback);
};

I use this lib in a Win32 exe, but it crashed on calling
TimerManager::addTimer(), the error is:
"Run-time check failure #0 - The value of ESP was not properly saved
across a function call ... ".

Both the exe and lib are compiled with "Struct Alignment" set to "4
Bytes". Finally, I find out a way make it work -- include the boost
like this :

#pragma pack(push,8)
#include <boost/xxxx>
#pragma pop()

But, I don't know why? Could anybody here help to clear this question?

I'm using MS Viusal C++ 2005.

Thanks!

-- Neil.Fang.CN


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