tree.hh 无法在 Ubuntu 14.04 上编译
tree.hh doesn't compile on Ubuntu 14.04
我使用的是来自http://tree.phi-sci.com/download.html.它会产生错误(请参见下文)。我该怎么修?这个类怎么会产生这么多错误?提前谢谢你的建议?
In file included from item_tree.h:4:0,
from Player.h:44,
from xinemediaplayer.c:26:
tree.hh:82:36: error: expected ‘,’ or ‘...’ before ‘&&’ token
tree(tree<T, tree_node_allocator>&&); // move constructor^M
^
tree.hh:82:38: error: invalid constructor; you probably meant ‘tree<T, tree_node_allocator> (const tree<T, tree_node_allocator>&)’
tree(tree<T, tree_node_allocator>&&); // move constructor^M
^
tree.hh:85:70: error: expected ‘,’ or ‘...’ before ‘&&’ token
tree<T,tree_node_allocator>& operator=(tree<T, tree_node_allocator>&&); // move assignment^M
^
tree.hh:503:64: error: expected ‘,’ or ‘...’ before ‘&&’ token
tree<T, tree_node_allocator>::tree(tree<T, tree_node_allocator>&& x) ^M
^
tree.hh:503:1: error: prototype for ‘tree<T, tree_node_allocator>::tree(tree<T, tree_node_allocator>)’ does not match any in class ‘tree<T, tree_node_allocator>’
tree<T, tree_node_allocator>::tree(tree<T, tree_node_allocator>&& x) ^M
^
tree.hh:81:3: error: candidates are: tree<T, tree_node_allocator>::tree(const tree<T, tree_node_allocator>&)
tree(const tree<T, tree_node_allocator>&); // copy constructor^M
^
tree.hh:80:3: error: tree<T, tree_node_allocator>::tree(const tree<T, tree_node_allocator>::iterator_base&)
tree(const iterator_base&);^M
^
tree.hh:496:1: error: tree<T, tree_node_allocator>::tree(const T&)
tree<T, tree_node_allocator>::tree(const T& x) ^M
^
tree.hh:490:1: error: tree<T, tree_node_allocator>::tree()
tree<T, tree_node_allocator>::tree() ^M
^
tree.hh:562:98: error: expected ‘,’ or ‘...’ before ‘&&’ token
tree<T,tree_node_allocator>& tree<T, tree_node_allocator>::operator=(tree<T, tree_node_allocator>&& x)^M
^
tree.hh: In member function ‘tree<T, tree_node_allocator>& tree<T, tree_node_allocator>::operator=(tree<T, tree_node_allocator>)’:...
tree.hh的一个例子:
64 template <class T, class tree_node_allocator = std::allocator<tree_node_<T> > >
65 class tree {
66 protected:
67 typedef tree_node_<T> tree_node;
68 public:
69 /// Value of the data stored at a node.
70 typedef T value_type;
71
72 class iterator_base;
73 class pre_order_iterator;
74 class post_order_iterator;
75 class sibling_iterator;
76 class leaf_iterator;
77
78 tree(); // empty constructor
79 tree(const T&); // constructor setting given element as head
80 tree(const iterator_base&);
81 tree(const tree<T, tree_node_allocator>&); // copy constructor
82 tree(tree<T, tree_node_allocator>&&); // move constructor
83 ~tree();
84 tree<T,tree_node_allocator>& operator=(const tree<T, tree_node_allocator>&); // copy assignment
85 tree<T,tree_node_allocator>& operator=(tree<T, tree_node_allocator>&&); // move assignment
86
87 /// Base class for iterators, only pointers stored, no traversal logic.
88 #ifdef __SGI_STL_PORT
89 class iterator_base : public stlport::bidirectional_iterator<T, ptrdiff_t> {
90 #else
Makefile是:
1 PLUGIN = xinemediaplayer
2 OBJS = $(PLUGIN).o Control.o Player.o Reel.o SpuDecode.o Utils.o
3 curl_download.o imagetools.o
4 item_tree.o m3u_parser.o pls_parser.o timecounter.o
5 xineOsd.o xineOsdInfoMenu.o xineOsdFunction.o Playlist.o
6 VDRDIR = ../../..
7 LIBDIR = ../../lib
8 TMPDIR = /tmp
9 -include $(VDRDIR)/Make.config
10 ARCHIVE = $(PLUGIN)-$(VERSION)
11 PACKAGE = vdr-$(ARCHIVE)
12 OBJS += cddb.o cdtext.o cdrom.o
13 OBJS += XineLib.o GstreamerLib.o gstTools.o ExternalLib.o
14 LIBS += -lxine `pkg-config --libs gstreamer-0.10` `pkg-config --libs gstreamer-interfaces-0.10`
15 INCLUDES += `pkg-config --cflags gstreamer-0.10` `pkg-config --cflags gstreamer-interfaces-0.10`
16 -include $(VDRDIR)/Make.common
17 INCLUDES +=
18 INCLUDES +=`taglib-config --cflags`
19 LDFLAGS +=`taglib-config --libs`
20 LIBS += `curl-config --libs` -lcdio -lcddb
21
22 DEFINES += -DPLAYER_VERSION="$(PLAYER_VERSION)" -D__LINUX__ -D__STL_CONFIG_H
23
24 target-for-compatibility-with-vanilla-vdr:
25 $(LIBDIR)/$@.$(APIVERSION)
Make.config:
1 REELVDR=1
2 DEBUG = 1
3 VDRVER ?= 2.1
4 CCACHE := $(shell which ccache)
5 MAKE += -j3
6 LSB_RELEASE := $(shell lsb_release -sr)
7 MACHINE ?= -m32 -march=pentium3 -mmmx -msse -mfpmath=sse
8 CC = $(CCACHE) $(DISTCC) $(CROSS)gcc
9 CFLAGS = -O2 -g -pg $(MACHINE)
10 CXX = $(CCACHE) $(DISTCC) $(CROSS)g++
11 CXXFLAGS = -g3 -funroll-loops -fomit-frame-pointer $(MACHINE) -Wall -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -D_ LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
12 STRIP = $(CROSS)strip
13 export CC CXX CFLAGS CXXFLAGS
14 CC := $(CC)-4.8
15 CXX := $(CXX)-4.8
16 DEFINES += -DDVBAPI_V5
17 DEFINES += -DNEW_FFMPEG
18 USEMYSQL = 1
19 DEVICE_ATTRIBUTES = 1
20 DVBDIR := /usr/src/linux-headers-3.13.0-66-generic/include/config/dvb
21 VDRVER := 2.1
amp&是C++11的特性。进行g++调用时,应使用--std=c++11
或--std=gnu++11
命令行选项。
相关文章:
- 在 Ubuntu 18.04 上编译 GLSL 着色器时"不支持 GLSL 3.30"?
- 在 Ubuntu 中编译 SuiteSparse,在安装 CHOLMOD 时中断
- 如何在 Ubuntu 上编译 OpenGL 项目?
- 在 ubuntu 焦点上编译虚幻引擎 4.25 时出错
- 在 Ubuntu 16.04 LTS 上使用 c++ 编译问题?
- 编译问题与 Ubuntu Linux
- Ubuntu 下的 Cmake 和 Intel IPP 的编译问题
- 在Linux/Ubuntu中编译openCV应用程序时,如何解决未定义的引用cv:..?
- 如何解决我在 Ubuntu 19.04 下使用 GLFW 时遇到的这个编译问题?
- wxWebView在Ubuntu上的编译问题
- 如何在Ubuntu中使用Visual Studio代码编译C++代码
- 在 Ubuntu 18.04 上,我编译的 cpp 可执行文件找不到 VTK7 依赖项
- 在 Xubuntu 19.04 中编译 c++ 是否应该与在 Ubuntu 18.04 中编译 c++ 不同
- 针对 ubuntu 和 Mac 编译的差异
- G++ 编译:在 Ubuntu 18.04 上对 'ATL_<...>' 的未定义引用
- cmake cuda在Windows上单独的编译静态LIB链接错误,但在Ubuntu上没有
- 加密蛋白使编译问题Ubuntu
- Open AL 的函数在 ubuntu 中使用 g++ 编译时给出未定义引用的错误
- 拥有LLVM IR库如何从Ubuntu将其交叉编译到iOS,Android,Windows和Mac?
- 交叉编译Ubuntu-Win7使用自定义Makefile代替qmake