M HYPE SPLASH
// general

build with g++ fails: what does error: declaration of ‘.... throw ....’ has a different exception specifier ... mean

By John Peck

I am trying to install a "toolbox" for a laser device () and I am getting this message when I try to build it (command in section 5.2):

 Building Sick LMS mex... Building with 'g++'. /home/ark3420/SICK/sicktoolbox-1.0.1/matlab/../c++/drivers/lms/sicklms-1.0/SickLMSBufferMonitor.cc :131:48: error: declaration of ‘SickToolbox::SickLMSBufferMonitor::~SickLMSBufferMonitor() throw (SickToolbox::SickThreadException)’ has a different exception specifier In file included from /home/ark3420/SICK/sicktoolbox-1.0.1/matlab/../c++/drivers/lms/sicklms-1.0/SickLMS.hh: 24:0,from /home/ark3420/SICK/sicktoolbox-1.0.1/matlab/../c++/drivers/lms/sicklms-1.0/SickLMSBufferMonitor.cc:24:0, /home/ark3420/SICK/sicktoolbox-1.0.1/matlab/../c++/drivers/lms/sicklms-1.0/SickLMSBufferMonitor.hh:44:5: error: from previous declaration ‘SickToolbox::SickLMSBufferMonitor::~SickLMSBufferMonitor() noexcept (true)’ ./build_mex: Build failed!

Any clues as to what I could do to resolve this appreciated. One issue is that this toolbox was written some years ago when Ubuntu 7 was current so i suppose that might be part of the problem!

thanks in advance

2 Answers

There are double declarations for a thow of SickToolbox::SickLMSBufferMonitor::~SickLMSBufferMonitor() one in

/home/ark3420/SICK/sicktoolbox-1.0.1/matlab/../c++/drivers/lms/sicklms-1.0/SickLMS.hh - line 24

and another one in

/home/ark3420/SICK/sicktoolbox-1.0.1/matlab/../c++/drivers/lms/sicklms-1.0/SickLMSBufferMonitor.hh - line 44

open an editor to both files and check for the one that makes more sense. You can try to uncomment one declaration and see if this works. Or contact the author of the source.

10

So it looks like the line:

 SickLMSBufferMonitor::~SickLMSBufferMonitor( ) { }

was replaced with

 SickLMSBufferMonitor::~SickLMSBufferMonitor( ) throw (SickToolbox::SickThreadException) { }

to resolve this problem.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy