CloudPolis / webdav-client-cpp

:cloud: C++ WebDAV Client provides easy and convenient to work with WebDAV-servers.
http://cloudpolis.github.io/webdav-client-cpp/
Other
120 stars 52 forks source link

CMAKE_CXX_FLAGS: -pthread missing? #30

Closed telkamp closed 6 years ago

telkamp commented 6 years ago

I needed to add "-pthread" to CMAKE_CXX_FLAGS in CMakeLists.txt to get the tests linking (tests/check): 'set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread")' Without -pthread, I got the following error from the linker: libwdc.a(client.cpp.o): In functionstd::thread::thread<WebDAV::Client::async_download(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (bool)>, std::function<int (void*, unsigned long, unsigned long, unsigned long, unsigned long)>) const::{lambda()#1}>(WebDAV::Client::async_download(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (bool)>, std::function<int (void*, unsigned long, unsigned long, unsigned long, unsigned long)>) const::{lambda()#1}&&)': client.cpp:(.text+0x51a5): undefined reference topthread_create'

-> I'm using Ubuntu 17.04 with gcc 6.3.0 See also https://stackoverflow.com/questions/34933042/undefined-reference-to-pthread-create-error-when-making-c11-application-with

rusdevops commented 6 years ago

Please, tell what version of WDC you use ? Try use last version - 1.0.9.

Sent from my Meizu M3s using FastHub

telkamp commented 6 years ago

I've tested it with the current version 1.0.9 - now it works! Thank you for your support.