diff options
author | bubnikv <bubnikv@gmail.com> | 2020-03-12 11:38:22 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2020-03-12 11:42:25 +0300 |
commit | ccbf5379abe907a2c15f06f64f1839fe47d67c3b (patch) | |
tree | 10b1dbaadfde62e40821290017deb8b8acc98b2c /src/slic3r | |
parent | c73493eba579af26507b7b7a11538445ae314d66 (diff) |
More detailed logging of hid_init() on unixes to detect why
loading of "libudev.so.1" or "libudev.so.0" failed.
Diffstat (limited to 'src/slic3r')
-rw-r--r-- | src/slic3r/GUI/Mouse3DController.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/slic3r/GUI/Mouse3DController.cpp b/src/slic3r/GUI/Mouse3DController.cpp index 178c52f1c..3c1ffeb3e 100644 --- a/src/slic3r/GUI/Mouse3DController.cpp +++ b/src/slic3r/GUI/Mouse3DController.cpp @@ -473,7 +473,16 @@ void Mouse3DController::run() int res = hid_init(); if (res != 0) { // Give up. - BOOST_LOG_TRIVIAL(error) << "Unable to initialize hidapi library"; +#if defined(__unix__) || defined(__unix) || defined(unix) + if (res == -1) + // Hopefully this error code comes from our bundled patched hidapi. In that case, -1 is returned by hid_wrapper_udev_init() and it mean + BOOST_LOG_TRIVIAL(error) << "Unable to initialize hidapi library: failed to load libudev.so.1 or libudev.so.0"; + else if (res == -2) + // Hopefully this error code comes from our bundled patched hidapi. In that case, -2 is returned by hid_wrapper_udev_init() and it mean + BOOST_LOG_TRIVIAL(error) << "Unable to initialize hidapi library: failed to resolve some function from libudev.so.1 or libudev.so.0"; + else +#endif // unixes + BOOST_LOG_TRIVIAL(error) << "Unable to initialize hidapi library"; return; } |