aguinet / usbtop

usbtop is a top-like utility that shows an estimated instantaneous bandwidth on USB buses and devices.
BSD 3-Clause "New" or "Revised" License
277 stars 45 forks source link

Unbreak build against Boost 1.67 and 1.69 #15

Closed jbeich closed 5 years ago

jbeich commented 6 years ago

Regressed by https://github.com/boostorg/thread/commit/1e84b978b2bb. Found downstream (error log). Let's use imported targets for simplicity unless they break build with ancient CMake/Boost.

$ cat foo.cc
#include <boost/thread.hpp>

void foo() {}

int main()
{
  boost::thread capturing_th(foo);
  return 0;
}

$ clang++ -fuse-ld=lld foo.cc -I/usr/local/include -L/usr/local/lib/ -lboost_thread -lboost_system
/usr/bin/ld: error: undefined symbol: pthread_condattr_init
>>> referenced by foo.cc
>>>               /tmp/foo-060c75.o:(boost::pthread::cond_init(pthread_cond*&))

/usr/bin/ld: error: undefined symbol: pthread_condattr_setclock
>>> referenced by foo.cc
>>>               /tmp/foo-060c75.o:(boost::pthread::cond_init(pthread_cond*&))

/usr/bin/ld: error: undefined symbol: pthread_condattr_destroy
>>> referenced by foo.cc
>>>               /tmp/foo-060c75.o:(boost::pthread::cond_init(pthread_cond*&))

@yurivict, this PR obsoletes 8025ef336089 from #13 (aka patch-CMakeLists.txt).

jbeich commented 6 years ago

After boostorg/system@2fa0a00583a3a7 build fails again, see error log. ab4c2db024d5 should fix it.

In file included from src/buses.cpp:37:
In file included from include/usbtop/buses.h:34:
In file included from include/usbtop/usb_bus.h:34:
In file included from include/usbtop/usb_device.h:35:
include/usbtop/usb_stats.h:44:21: error: expected class name
class Stats: boost::noncopyable
                    ^
include/usbtop/usb_stats.h:84:24: error: expected class name
class UsbStats: boost::noncopyable
                       ^
In file included from src/buses.cpp:37:
In file included from include/usbtop/buses.h:34:
In file included from include/usbtop/usb_bus.h:34:
include/usbtop/usb_device.h:41:25: error: expected class name
class UsbDevice: boost::noncopyable
                        ^
In file included from src/buses.cpp:37:
In file included from include/usbtop/buses.h:34:
include/usbtop/usb_bus.h:45:22: error: expected class name
class UsbBus: boost::noncopyable
                     ^
4 errors generated.
aguinet commented 5 years ago

Hello!

Sorry for the very late reply... Is this possible to get your branch somewhere? Seems like it's been deleted from github!