简体   繁体   中英

Overriding error and looser throw specifier error

I came across looser throw specifier error and overriding error while compiling caffe related code. I do not know what these two kind of error is and why they pop out together and how to fix them. This is my error log:

/usr/local/include/boost/system/error_code.hpp:233:21: error: looser throw specifier for 'virtual const char* boost::system::error_category::std_category::name() const'
virtual const char * name() const BOOST_NOEXCEPT

  ^ 

/usr/include/c++/4.9/system_error:81:21: error: overriding 'virtual const char* std::error_category::name() const noexcept'

name() const noexcept = 0;

  ^ 

And this is the compile script:

#!/bin/sh

source=deep_image_analogy/source

nvcc $source/*.cpp $source/*.cu -o demo \
        -std=c++11 \
        -I./include \
        -L./build/lib \
        -lopencv_core \
        -lopencv_highgui \
        -lopencv_imgproc \
        -lboost_system \
        -lcublas \
        -lcaffe \
        -lglog

Thanks!

I've run into the same problem when compiling Deep Image Analogy on Ubuntu 17.10 + CUDA 8 + GCC 5, and I finally found a solution. This boost ticket helped me to solve the issue: #13049

You should look for the boost nvcc.hpp config file (in my system it was located at /usr/local/include/boost/config/compiler/nvcc.hpp) and then add the following line:

#define DBOOST_NO_CXX11_NOEXCEPT

There is actually a reference to the #13049 ticket on that configuration file (line 50). Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM