ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to get c++ default version after install ROS ?

asked 2021-09-14 10:25:38 -0500

ROS_LOVER gravatar image

How to get c++ default version after install ROS ?

edit retag flag offensive close merge delete

Comments

What operating system? Not sure if you are referring to Windows or Linux.

osilva gravatar image osilva  ( 2021-09-16 08:48:45 -0500 )edit

ubuntu system

ROS_LOVER gravatar image ROS_LOVER  ( 2021-10-19 08:33:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-19 08:59:51 -0500

osilva gravatar image

For Ubuntu, you can check in command terminal.

`gcc --version`

or

`aptitude show gcc`

If you want to check in code:

#include <iostream>
#include <typeinfo>

int main()
{
    if (__cplusplus == 201703L) std::cout << "C++17\n";
    else if (__cplusplus == 201402L) std::cout << "C++14\n";
    else if (__cplusplus == 201103L) std::cout << "C++11\n";
    else if (__cplusplus == 199711L) std::cout << "C++98\n";
    else std::cout << "pre-standard C++\n";

}
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-09-14 10:25:38 -0500

Seen: 176 times

Last updated: Oct 19 '21