Opened 20 years ago

Closed 17 years ago

#91 closed Bugs (None)

boost::threads uses msvc only function?

Reported by: matzebraun Owned by: Roland Schwarz
Milestone: Component: threads
Version: None Severity:
Keywords: Cc:

Description

Hi, I tried compiling boost::thread with cgywin and
mingw, and hit the following problem:
g++ -Wall -I.. -I../include -DBOOST_HAS_WINTHREADS
-I/usr/include/mingw -c thread/thread.cpp -o
thread/thread.o
thread/thread.cpp: In method
`boost::thread::thread(const
boost::function0<void,boost::empty_function_policy,boost::empty_function_mixin,allocator<boost::function_base>
> &)':
thread/thread.cpp:107: implicit declaration of function
`int boost::_beginthreadex(...)'

after looking at some comments in the header files it
seems that this function is only provided by msvcrt.dll
which is != standard win API. Would it be possible to
change the usage here? Or did I miss something?

Greetings,
          Matze

Change History (2)

comment:1 by Anthony Williams, 17 years ago

Logged In: YES 
user_id=60756

_beginthreadex is indeed part of msvcrt.dll, however
msvcrt.dll is a standard part of newer versions of Windows
(Windows 98 onwards, I believe), and a free download for
older versions.

In the latest version of the w32api headers for mingw, you
will find _beginthreadex declared in process.h. This
function is guarded by #ifdef __MSVCRT__, but that symbol is
defined by default in mingw, so _beginthreadex should be
available.

comment:2 by Roland Schwarz, 17 years ago

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