1

I am trying to install a "toolbox" for a laser device (http://sicktoolbox.sourceforge.net/docs/sicktoolbox-quickstart.pdf) 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 2

0

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
  • thank you, I shall try that. The code was written around 2007 and would have worked with gcc/g++ 4.1 whereas I am now trying to compile with 4.7. Is it possible that it was allowed in 4.1 but is no longer allowed in 4.7?
    – Steve G
    Aug 22, 2016 at 14:53
  • Let me please more about your environment where you try to compile this package. Double declarations are not allowed in c/c++ - no matter what version (for my understanding). But lets try if we can find the reason for this issue. I will try to compile this also if I know more about the environment you use.
    – 0x0C4
    Aug 22, 2016 at 15:38
  • That is very kind of you to offer. I am running LUBUNTU 16.04 and gcc 4.7.
    – Steve G
    Aug 23, 2016 at 7:19
  • I had to add #include <unistd.h> into SickBufferMonitor.hh & SickLIDAR.hh as mentioned in this blog link. Then the first steps ./configure, make and sudo make install worked ok and I was able to run one of the compiled test programs. The next steps cd matlab, ./config_mex also work ok. But then ./build_mex is where I get this throw error.
    – Steve G
    Aug 23, 2016 at 7:30
  • Well, I managed it to compile this source but I have only a Ubuntu 16.04 with gcc 5.4 I had to modify the following files: modified: c++/drivers/base/src/SickBufferMonitor.hh modified: c++/drivers/base/src/SickLIDAR.hh to add #include <unistd.h>
    – 0x0C4
    Aug 23, 2016 at 13:21
0

So it looks like the line:

    SickLMSBufferMonitor::~SickLMSBufferMonitor( ) { }

was replaced with

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

to resolve this problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .