Re: [CMake] undefined reference to 'pthread_create'

2016-02-04 Thread Rolf Eike Beer
Am Donnerstag, 4. Februar 2016, 10:53:37 schrieb rpela...@archlinux.info: > I believe that doesn't have anything to do with C11 flags. You are just > missing the link to the pthread library. I could be wrong. > > Try and add this to your cmake file: > find_package (Threads) First: >

Re: [CMake] undefined reference to 'pthread_create'

2016-02-04 Thread rpela...@archlinux.info
I believe that doesn't have anything to do with C11 flags. You are just missing the link to the pthread library. I could be wrong. Try and add this to your cmake file: find_package (Threads) target_link_libraries (myexecutable/lib ${CMAKE_THREAD_LIBS_INIT}) Sent from my iPhone > On Feb 4,

[CMake] undefined reference to 'pthread_create'

2016-02-04 Thread Aaron Boxer
Hello, I have a cmake project that uses C++11 threads. I have added the lines set (CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) CMAKE version is 3.2.2, running on Ubuntu. When I try to build, I get the error undefined reference to `pthread_create` Any ideas on how to fix this?

Re: [CMake] undefined reference to 'pthread_create'

2016-02-04 Thread J Decker
Probably didn't previously need pthreads until you updated to use C++11 features which brings in pthreads in the deadstart code... On Thu, Feb 4, 2016 at 8:53 AM, rpela...@archlinux.info wrote: > I believe that doesn't have anything to do with C11 flags. You are just >

Re: [CMake] undefined reference to 'pthread_create'

2016-02-04 Thread Aaron Boxer
Thanks. So, even though threading is part of the standard, I still need to link to pthreads library ? On Thu, Feb 4, 2016 at 11:53 AM, rpela...@archlinux.info < rpela...@archlinux.info> wrote: > I believe that doesn't have anything to do with C11 flags. You are just > missing the link to the

Re: [CMake] undefined reference to 'pthread_create'

2016-02-04 Thread J Decker
On Thu, Feb 4, 2016 at 9:55 AM, Aaron Boxer wrote: > Thanks. So, even though threading is part of the standard, I still need to > link to pthreads library ? Yes; sounds more like an issue for GCC :) I mean you don't have to tell it to link against c library or c++ runtime

Re: [CMake] undefined reference to 'pthread_create'

2016-02-04 Thread Aaron Boxer
Thanks, guys This is working now. Cheers, Aaron On Thu, Feb 4, 2016 at 1:05 PM, J Decker wrote: > On Thu, Feb 4, 2016 at 9:55 AM, Aaron Boxer wrote: > > Thanks. So, even though threading is part of the standard, I still need > to > > link to pthreads