Opened 15 years ago

Closed 13 years ago

Last modified 10 years ago

#1825 closed Bugs (fixed)

thread.hpp injects windows.h and breaks user application.

Reported by: pawels@… Owned by: Anthony Williams
Milestone: To Be Determined Component: thread
Version: Boost 1.35.0 Severity: Regression
Keywords: Cc:

Description

reduced testcase:

#include <boost/thread/thread.hpp>
int const ERROR = 1;

works fine with boost-1.34.1 and doesn't compile with 1.35.0.

Compiling...
example.cpp
example.cpp(2) : warning C4091: '' : ignored on left of 'const int' when no variable is declared
example.cpp(2) : error C2143: syntax error : missing ';' before 'constant'
example.cpp(2) : error C2059: syntax error : 'constant'

Change History (6)

comment:1 by Anthony Williams, 14 years ago

This is due to the dependency on boost.datetime, which includes <windows.h>.

comment:2 by Andrey Semashev, 14 years ago

Boost.DateTime is fixed now, so this ticket might be fixed, too.

in reply to:  2 ; comment:3 by rotoglup@…, 14 years ago

Replying to andysem:

Boost.DateTime is fixed now, so this ticket might be fixed, too.

As of boost_1_37_0, the problem still exists : windows.h is included by 'thread.hpp' due to 'boost/date_time/microsec_time_clock.hpp'

in reply to:  3 comment:4 by Andrey Semashev, 14 years ago

Replying to rotoglup@gmail.com:

Replying to andysem:

Boost.DateTime is fixed now, so this ticket might be fixed, too.

As of boost_1_37_0, the problem still exists : windows.h is included by 'thread.hpp' due to 'boost/date_time/microsec_time_clock.hpp'

The fix didn't make it into 1.37. It will be released in 1.38. It is now available in trunk and branches/release.

comment:5 by Andrey Semashev, 13 years ago

Resolution: fixed
Status: newclosed

comment:6 by anonymous, 10 years ago

I have this problem, but I can build my application in debug configuration. However, when I switch to release, it doesn't build and gives me this error

error C2146: syntax error : missing ';' before identifier 'curr'	c:\libraries\boost\boost_1_46_1\boost\date_time\microsec_time_clock.hpp	99	1	SceneStateRecognition

error C2065: 'curr' : undeclared identifier	c:\libraries\boost\boost_1_46_1\boost\date_time\microsec_time_clock.hpp	99	1	SceneStateRecognition

I could not post the whole thing, but this is more or less what is coming out...

Does anyone know how to fix this?

Note: See TracTickets for help on using tickets.