jbeder / yaml-cpp

A YAML parser and emitter in C++
MIT License
5.06k stars 1.82k forks source link

Error building yaml-cpp as dependency for ROS #667

Open connorsoohoo opened 5 years ago

connorsoohoo commented 5 years ago

I'm getting an error building the image_common package in ROS. It is related to the yaml-cpp dependency not being the right version. But I have the latest version of yaml-cpp (0.6.2). I've seen issue #508 but I was able to build the project successfully. Can anyone advise?

screen shot 2019-02-05 at 5 21 03 am
tt4g commented 5 years ago

I think that the compiler you are using does not support the noexpected keyword.

The noexcept keyword was added in C++11. If the compiler does not support C ++ 11, we will get error message.

example for gcc 4.5.4: https://wandbox.org/permlink/j9Yqb5ILFFh4wgbR

#include <iostream>
#include <cstdlib>

#include <stdexcept>

class Foo : public std::runtime_error 
{
public:
    Foo(const std::string& what_arg) 
        : std::runtime_error(what_arg) 
    { };

    virtual ~Foo() noexcept;
};

Foo::~Foo() noexcept {}

int main()
{
    return 0;
}
prog.cc:14:20: error: expected ';' before 'noexcept'
prog.cc:17:13: error: expected initializer before 'noexcept'