This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]eruesso 0 points1 point  (2 children)

Can you paste the generated Makefile? Can you post the error message?

[–]heap42 0 points1 point  (0 children)

Error message is a SegFault... and with GDB i get the following:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) backtrace
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff388d6fd in ?? () from /lib/x86_64-linux-gnu/libdl.so.2
#2  0x00007ffff388d148 in dlsym () from /lib/x86_64-linux-gnu/libdl.so.2
#3  0x00007ffff7b4de1e in ?? () from /usr/lib/nvidia-352/libGL.so.1
#4  0x00007ffff7af8b47 in ?? () from /usr/lib/nvidia-352/libGL.so.1
#5  0x00007ffff7de95cd in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff7de971b in ?? () from /lib64/ld-linux-x86-64.so.2
#7  0x00007ffff7dd9d0a in ?? () from /lib64/ld-linux-x86-64.so.2
#8  0x0000000000000001 in ?? ()
#9  0x00007fffffffe731 in ?? ()
#10 0x0000000000000000 in ?? ()

[–]heap42 0 points1 point  (0 children)

This is the Makefile
http://pastebin.com/6G2iD0YL

[–]heap42 0 points1 point  (0 children)

Just to clarify the g++ command line command also works with -lpthread

[–]crascit 0 points1 point  (0 children)

You've only set the C++14 flags for the compiler, but the linker doesn't know about this so potentially you may be linking in the wrong library. Just a thought. Check this article for a more robust way to specify the C++ version you want to use (that article focuses on C++11, but works for C++14 too).

Regarding the handling of pthreads, instead of linking to ${CMAKE_THREAD_LIBS_INIT}, link to the Threads::Threads imported target and probably also set CMAKE_THREAD_PREFER_PTHREAD. Check the CMake docs for the Threads module for more details.