mans
mans

Reputation: 18178

compiling a simple application using boost process generate error

I am using Boost 1.64 and generated a project in VS 2013 using CMake. The code is as follow:

#include <boost\process.hpp>
namespace bp = boost::process;
int main()
{
    int result = bp::system("g++ main.cpp");
}

when I try to call it, I am getting this error:

Error   1   error C3646: 'noexcept' : unknown override specifier    C:\Local\boost\boost\process\detail\config.hpp  

do I neeed to add any other header file to be able to compile the code?

Note: I know that probably the code doesn't run, as on windows I don't have gcc, but this is not my problem, I just copy sample code form boost document to make sure I did not change any art of it.

Edit 1

I change the code to this:

#define BOOST_NO_CXX11_NOEXCEPT
#include <boost\process.hpp>
namespace bp = boost::process;
int main()
{
      int result = bp::system("g++ main.cpp");
}

But I am still getting the same error. How can I fix the problem?

Upvotes: 2

Views: 585

Answers (1)

Jonas
Jonas

Reputation: 7017

The problem is that noexcept is not supported by VS 2013. You need to define BOOST_NO_CXX11_NOEXCEPT and then include <boost/config.hpp>, as documented here.

BOOST_NO_CXX11_NOEXCEPT: The compiler does not support noexcept.

Upvotes: 2

Related Questions