Code fails to compile, while trying to use boost::thread with nacl
examples. The error suggests that the threading support is not on by
default for NACL.
I also had a look at pi_generator using pthreads, but found nothing
special.
So, I think, either some flag needs to be turned on or some compiler
options needs to be provided, but not sure which and how.
Following is code snippet::
...
15 #include <boost/thread/thread.hpp>
...
51 thread* thr=new boost::thread((&method),NULL);
...
Following is log snippet::
scons: Building targets ...
/Developer/nacl_sdk/pepper_15/toolchain/mac_x86_newlib/bin/i686-nacl-g+
+ -o hello_world/dbg_x86_32/helper_functions.o -c -std=gnu++98 -Wno-
long-long -Wall -Wswitch-enum -pthread -pedantic -I/Users/yogeshd/src/
officebase_qocpp/common/jdkcpp/src -I/Users/yogeshd/src/boost_1_47_0 -
O0 -g -m32 -D_GNU_SOURCE=1 -D__STDC_FORMAT_MACROS=1 -D_BSD_SOURCE=1 -
D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE=600 -I/Developer/nacl_sdk/
pepper_15 hello_world/helper_functions.cc
In file included from /Users/yogeshd/src/boost_1_47_0/boost/thread/
detail/platform.hpp:17,
from /Users/yogeshd/src/boost_1_47_0/boost/thread/
thread.hpp:12,
from hello_world/helper_functions.cc:15:
/Users/yogeshd/src/boost_1_47_0/boost/config/requires_threads.hpp:
47:5: error: #error "Compiler threading support is not turned on.
Please set the correct command line options for threading: -pthread
(Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
In file included from /Users/yogeshd/src/boost_1_47_0/boost/thread/
thread.hpp:12,
from hello_world/helper_functions.cc:15:
--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To post to this group, send email to native-cli...@googlegroups.com.
To unsubscribe from this group, send email to native-client-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/native-client-discuss?hl=en.
./boost/config/requires_threads.hpp:47:5: error: #error "Compiler
threading support is not turned on. Please set the correct command
line options for threading: -pthread (Linux), -pthreads (Solaris) or -
mthreads (Mingw32)"
I am not sure where to set this option
On Nov 23, 7:16 pm, Evgeniy Stepanov <euge...@google.com> wrote:
> Try boost fromhttp://code.google.com/p/naclports/, it is known to work.
On Nov 25, 4:12 pm, Evgeniy Stepanov <euge...@google.com> wrote:
> You are using newlib, then. There is a lot of feature detection C++ code in
> boost that does not really know about newlib. Good luck with that.
>
You can easily find what newlib is by using your favorite search engine.
> or, are you referring to SDK version (I am using pepper_15)
There are 2 toolchains, in your case: "mac_x86" and "mac_x86_newlib".
Your pasted error message suggests that you are using the latter,
while boost in naclports only has support for the former.
--
Egor Pasko
On Nov 25, 6:38 pm, Egor Pasko <pa...@google.com> wrote: