Opened 9 years ago

Closed 9 years ago

#8832 closed Bugs (wontfix)

Boost and /clr code

Reported by: anonymous Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

When using boost in an application which uses threads it gives the fault message:

1>c:\program files (x86)\boost\boost_1_47\boost\thread\win32\thread_primitives.hpp(314): error C2472: 'boost::detail::win32::interlocked_bit_test_and_set' cannot be generated in managed code: 'Found an intrinsic not supported in managed code'; compile with /clr to generate a mixed image

    1>c:\program files (x86)\boost\boost_1_47\boost\thread\win32\basic_timed_mutex.hpp(160): error C2472: 'boost::detail::basic_timed_mutex::unlock' cannot be generated in managed code: 'Found an intrinsic not supported in managed code'; compile with /clr to generate a mixed image

Found on the internet: Boost.thread uses some thread local storage calls that don't work if you directly link them with CLR code. In VS2008 the link would succeed but you'd crash on startup -- I suspect this is a symptom of the same problem, VS2010-style.

On stackoverflow I found the following workaround: It is necessary to build boost.thread as a DLL instead of linking it statically, and maybe it'll link for you that way...

Change History (5)

comment:1 by viboes, 9 years ago

Component: threadsthread
Owner: changed from Anthony Williams to viboes
Status: newassigned

What do you expect from this ticket?

comment:2 by anonymous, 9 years ago

Maybe there is a way to avoid this, so when compiling a program in managed code, there isn't any intrinsic which is not supported in managed code.

comment:3 by viboes, 9 years ago

Could you try to compile Boost.Thread with /clr as suggested

"compile with /clr to generate a mixed image"?

comment:4 by anonymous, 9 years ago

I haven)t tried it, because I did not use the library which gives this problem, because my program needs to work. I have decided to use something else, but I will try when my program is done, to compile it as suggested.

comment:5 by viboes, 9 years ago

Resolution: wontfix
Status: assignedclosed
Note: See TracTickets for help on using tickets.