ROS Kinetic编译旧版本程序出现 error: ‘shared_ptr’ in namespace ‘std’ does not name a type
2016-11-17 21:24
1146 查看
error: ‘shared_ptr’ in namespace ‘std’ does not name a type
今天在ROS-Kinetic版本中编译indigo版本编译通过的程序,出现了如下问题/opt/ros/kinetic/include/moveit/macros/declare_ptr.h:53:16: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
typedef std::shared_ptr<const Type> Name##ConstPtr;
网上搜了解决办法如下:
用G++编译项目的时候发生标题上的错误,原因是,这是c++ 11标准的。在给g++传递命令行的时候加上-std=c++0x就行了。
我的cmakelists里面要这样改:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
references:
http://www.cmake.org/Wiki/CMake/Tutorials/C%2B%2B11Flags http://stackoverflow.com/questions/12329226/a-short-c-file-and-makefile-i-can-make-in-the-shell-but-get-lots-of-error-wh https://github.com/RobotLocomotion/drake/issues/92
相关文章推荐
- ros kinetic版编译error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
- error: ‘shared_ptr’ in namespace ‘std’ does not name a type
- Error: ‘shared_ptr’ in namespace ‘std’ does not name a type
- Compiler Error Message: CS0234: The type or namespace name 'BorderDetails' does not exist in the class or namespace 'Infragistics.WebUI.Shared' (are you missing an assembly reference?)
- window下用android-ndk-r9d编译.so文件之mutex in namespace 'std' does not name a type
- 由“error string in namespace std does not name a type”错误引发
- ERROR:shared_ptr does not name a type
- ndk 编译webrtc出现 rw_lock_posix.h:35: error: 'pthread_rwlock_t' does not name a type
- Error:The type or namespace name 'Office' does not exist in the namespace 'Microsoft' 解决方法
- android4.2 编译时出现 : error: 'z_const' does not name a type
- std::string VS string 和 error:'string' does not name a type
- CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System.Data'
- Python中3+版本运行2+版本程序出现TypeError: a bytes-like object is required, not 'str'之读取PDF中的图片
- 解决The type or namespace name \'XXXX\' does not exist in the namespace \'XXXXXXXXX\' 的错误
- C++ 编译出现: error C2871: 'std' : does not exist or is not a namespace 怎么解决
- opencv2.0 源码安装 for x86 make出现error: 'ptrdiff_t' does not name a type 解决
- android4.0编译 error: ‘ptrdiff_t’ does not name a type
- ndk编译错误:error: 'override' does not name a type
- [EntLib]解决The type or namespace name 'Data' does not exist in the namespace 'Microsoft.Practices.EnterpriseLibrary' 的错误
- Python程序编译运行出现错误:IndentationError: unindent does not match any outer indentation level