<div dir="ltr"><div><div>Thanks, guys!!!! This is working now.<br><br></div>Cheers,<br></div>Aaron<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 4, 2016 at 1:05 PM, J Decker <span dir="ltr"><<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Feb 4, 2016 at 9:55 AM, Aaron Boxer <<a href="mailto:boxerab@gmail.com">boxerab@gmail.com</a>> wrote:<br>
> Thanks. So, even though threading is part of the standard, I still need to<br>
> link to pthreads library ?<br>
<br>
</span>Yes; sounds more like an issue for GCC :)   I mean you don't have to<br>
tell it to link against c library or c++ runtime libraries... and it<br>
IS pthread specific so it's not like there's going to be some<br>
alternative provider for such services.<br>
<br>
using MinGW under linux to get a windows output it links automatically<br>
to a 'winpthreads.dll' which then becomes a runtime requirement... so<br>
it's not impossible for the compiler suite to do.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> On Thu, Feb 4, 2016 at 11:53 AM, <a href="mailto:rpelapur@archlinux.info">rpelapur@archlinux.info</a><br>
> <<a href="mailto:rpelapur@archlinux.info">rpelapur@archlinux.info</a>> wrote:<br>
>><br>
>> I believe that doesn't have anything to do with C11 flags. You are just<br>
>> missing the link to the pthread library. I could be wrong.<br>
>><br>
>> Try and add this to your cmake file:<br>
>><br>
>> find_package (Threads)<br>
>><br>
>> target_link_libraries (myexecutable/lib ${CMAKE_THREAD_LIBS_INIT})<br>
>><br>
>><br>
>><br>
>> Sent from my iPhone<br>
>><br>
>> On Feb 4, 2016, at 10:42 AM, Aaron Boxer <<a href="mailto:boxerab@gmail.com">boxerab@gmail.com</a>> wrote:<br>
>><br>
>> Hello,<br>
>> I have a cmake project that uses C++11 threads.<br>
>> I have added the lines<br>
>><br>
>> set (CMAKE_CXX_STANDARD 14)<br>
>> set(CMAKE_CXX_STANDARD_REQUIRED ON)<br>
>><br>
>><br>
>> CMAKE version is 3.2.2, running on Ubuntu.<br>
>><br>
>> When I try to build, I get the error<br>
>><br>
>> undefined reference to `pthread_create`<br>
>><br>
>> Any ideas on how to fix this?<br>
>><br>
>> Thanks!<br>
>> Aaron<br>
>><br>
>> --<br>
>><br>
>> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
>><br>
>> Please keep messages on-topic and check the CMake FAQ at:<br>
>> <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>><br>
>> Kitware offers various services to support the CMake community. For more<br>
>> information on each offering, please visit:<br>
>><br>
>> CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
>> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
>> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
><br>
><br>
><br>
> --<br>
><br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at:<br>
> <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
><br>
> Kitware offers various services to support the CMake community. For more<br>
> information on each offering, please visit:<br>
><br>
> CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>