红联Linux门户
Linux帮助

linux下编译opencv-0.9.7的问题:in file include from...

发布时间:2011-01-12 10:43:42来源:红联作者:youxiangtt
[i=s] 本帖最后由 youxiangtt 于 2011-1-13 10:35 编辑 [/i]

我在linux下交叉编译opencv-0.9.7时,./configure 能够通过,但是make时却出现了如下问题:
in file included from /opt/xscalve1/arm-linux/include/linux/fs.h:19,
from cvcap_v41.cpp:142:

/opt/xscalve1/arm-linux/include/linux/prio_tree.h:22: error:'pgoff_t‘ is used
as a type ,but is not defined as a type.

/opt/xscalve1/arm-linux/include/linux/prio_tree.h:23: error:'pgoff_t‘ is used
as a type ,but is not defined as a type.

/opt/xscalve1/arm-linux/include/linux/prio_tree.h:27:error:type specifier
omitted for parameter'pgoff_t'

/opt/xscalve1/arm-linux/include/linux/prio_tree.h:27:error:parse error before
',' token

/opt/xscalve1/arm-linux/include/linux/prio_tree.h:29:error:'iter' undeclared
(first use this function)

/opt/xscalve1/arm-linux/include/linux/prio_tree.h:29:error:(Each undeclared
identifier is reported only once for each function it appears in.)

/opt/xscalve1/arm-linux/include/linux/prio_tree.h:29:error:'root' undeclared
(first use this function)

/opt/xscalve1/arm-linux/include/linux/prio_tree.h:30:error:'r_index'
undeclared (first use this function)

/opt/xscalve1/arm-linux/include/linux/prio_tree.h:31:error:'h_index'
undeclared (first use this function)


希望有人能帮我解决下上面的问题啊。我是新手,在网上搜索了好多。还是没能解决啊。困扰很久了啊。。。。。。。。。


prio_tree.h的代码[code]
#ifndef _LINUX_PRIO_TREE_H
#define _LINUX_PRIO_TREE_H

struct prio_tree_node {
struct prio_tree_node *left;
struct prio_tree_node *right;
struct prio_tree_node *parent;
};

struct prio_tree_root {
struct prio_tree_node *prio_tree_node;
unsigned int index_bits;
};

struct prio_tree_iter {
struct prio_tree_node *cur;
unsigned long mask;
unsigned long value;
int size_level;

struct prio_tree_root *root;
pgoff_t r_index;
pgoff_t h_index;
};

static inline void prio_tree_iter_init(struct prio_tree_iter *iter,
struct prio_tree_root *root, pgoff_t r_index, pgoff_t h_index)
{
iter->root = root;
iter->r_index = r_index;
iter->h_index = h_index;
}

#define INIT_PRIO_TREE_ROOT(ptr) \
do { \
(ptr)->prio_tree_node = NULL; \
(ptr)->index_bits = 1; \
} while (0)

#define INIT_PRIO_TREE_NODE(ptr) \
do { \
(ptr)->left = (ptr)->right = (ptr)->parent = (ptr); \
} while (0)

#define INIT_PRIO_TREE_ITER(ptr) \
do { \
(ptr)->cur = NULL; \
(ptr)->mask = 0UL; \
(ptr)->value = 0UL; \
(ptr)->size_level = 0; \
} while (0)

#define prio_tree_entry(ptr, type, member) \
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))

static inline int prio_tree_empty(const struct prio_tree_root *root)
{
return root->prio_tree_node == NULL;
}

static inline int prio_tree_root(const struct prio_tree_node *node)
{
return node->parent == node;
}

static inline int prio_tree_left_empty(const struct prio_tree_node *node)
{
return node->left == node;
}

static inline int prio_tree_right_empty(const struct prio_tree_node *node)
{
return node->right == node;
}

#endif /* _LINUX_PRIO_TREE_H */


[/code]fs.h的部分代码[code]
#ifndef _LINUX_FS_H
#define _LINUX_FS_H

/*
* This file has definitions for some important file table
* structures etc.
*/

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include //提示的19行
#include
#include

struct iovec;
struct nameidata;
struct pipe_inode_info;
struct poll_table_struct;
struct kstatfs;
struct vm_area_struct;
struct vfsmount;




[/code]
cvcap_v41.cpp部分代码
[code]


#include "_highgui.h"
#if !defined WIN32 && defined HAVE_CAMV4L

#include
#include
#include
#include
#include
#include
#include

#include //提示的142行
#include
#include

/* Defaults - If your board can do better, set it here. Set for the most common type inputs. */
#define DEFAULT_V4L_WIDTH 640
#define DEFAULT_V4L_HEIGHT 480

#define CHANNEL_NUMBER 1
#define MAX_CAMERAS 8

#define MAX_DEVICE_DRIVER_NAME 80

/* Device Capture Objects */

typedef struct CvCaptureCAM_V4L
{
CvCaptureVTable* vtable;
int deviceHandle;
int bufferIndex;
int FirstCapture;
struct video_capability capability;
struct video_window captureWindow;
struct video_picture imageProperties;
struct video_mbuf memoryBuffer;
struct video_mmap *mmaps;
char *memoryMap;
IplImage frame;
}
CvCaptureCAM_V4L;

static void icvCloseCAM_V4L( CvCaptureCAM_V4L* capture );

static int icvGrabFrameCAM_V4L( CvCaptureCAM_V4L* capture );
static IplImage* icvRetrieveFrameCAM_V4L( CvCaptureCAM_V4L* capture );

static double icvGetPropertyCAM_V4L( CvCaptureCAM_V4L* capture, int property_id );
static int icvSetPropertyCAM_V4L( CvCaptureCAM_V4L* capture, int property_id, double value );

static int icvSetVideoSize( CvCaptureCAM_V4L* capture, int w, int h);


[/code]
文章评论

共有 2 条评论

  1. youxiangtt 于 2011-01-12 14:16:03发表:

    [i=s] 本帖最后由 youxiangtt 于 2011-1-13 10:34 编辑 [/i]

    怎么没有人帮忙解决呢?急啊

  2. alick 于 2011-01-12 13:11:44发表:

    交叉编译不是./configure吧,这应该是for PC的configure