bozhao
bozhao

Reputation: 51

Boost Log Run Time Error

I am trying to following this boost tutorial for its log lib Boost Log tutorial. Using the same code, as

#include <boost/log/trivial.hpp>

int main(int, char*[])
{
    BOOST_LOG_TRIVIAL(trace) << "A trace severity message";
    BOOST_LOG_TRIVIAL(debug) << "A debug severity message";
    BOOST_LOG_TRIVIAL(info) << "An informational severity message";
    BOOST_LOG_TRIVIAL(warning) << "A warning severity message";
    BOOST_LOG_TRIVIAL(error) << "An error severity message";
    BOOST_LOG_TRIVIAL(fatal) << "A fatal severity message";

    return 0;
}

The code can be successfully compiled as expected. However, when I run the code, a run-time error pop up as:Entry Point Not Found. The error message reads as:

The procedure entry point AcquireSRWLockShared could not be located in the dynamic link library KERNEL32.dll.

I used Boost lib for other purpose, like generating random numbers, so I guess the library itself is properly installed.

Can anyone help me with this please? Thank you.

Upvotes: 0

Views: 283

Answers (1)

Andrey Semashev
Andrey Semashev

Reputation: 10614

Apparently, your Boost libraries were built for Windows Vista and later while you are running an older Windows version.

You need to rebuild Boost for Windows XP. To do that you need to add define=BOOST_USE_WINAPI_VERSION=0x0501 to the b2 command line when building Boost and also define this macro similarly when building your code as well.

Upvotes: 1

Related Questions