即使看起来没有语法错误,我也会收到以下错误。 usb_libusb10.h(72):错误C2146:语法错误:缺少&#39 ;;'在标识符之前' cb'
产生错误的行在下面给出 -
fnusb_iso_cb cb;
我还试图通过使用" **"来强调这一行。在代码中。 以下是我正在使用的代码。
#pragma once
#include <Windows.h>
#include <afxwin.h>
#include "libfreenect.h"
#include <libusb.h>
// There are a few rules: PKTS_PER_XFER * NUM_XFERS <= 1000, PKTS_PER_XFER % 8 == 0.
#if defined(__APPLE__)
#define DEPTH_PKTBUF 2048
#define VIDEO_PKTBUF 2048
#define PKTS_PER_XFER 128
#define NUM_XFERS 4
#else
#define DEPTH_PKTBUF 1920
#define VIDEO_PKTBUF 1920
#if defined(_WIN32)
#define PKTS_PER_XFER 32
#define NUM_XFERS 8
#else
#define PKTS_PER_XFER 16
#define NUM_XFERS 16
#endif
#endif
typedef struct {
libusb_context *ctx;
int should_free_ctx;
} fnusb_ctx;
typedef struct {
freenect_device *parent; //so we can go up from the libusb userdata
libusb_device_handle *dev;
int device_dead; // set to 1 when the underlying libusb_device_handle vanishes (ie, Kinect was unplugged)
int VID;
int PID;
} fnusb_dev;
typedef struct {
fnusb_dev *parent; //so we can go up from the libusb userdata
struct libusb_transfer **xfers;
uint8_t *buffer;
**fnusb_iso_cb cb;**
int num_xfers;
int pkts;
int len;
int dead;
int dead_xfers;
} fnusb_isoc_stream;
int fnusb_num_devices(fnusb_ctx *ctx);
int fnusb_list_device_attributes(fnusb_ctx *ctx, struct freenect_device_attributes** attribute_list);
int fnusb_init(fnusb_ctx *ctx, freenect_usb_context *usb_ctx);
int fnusb_shutdown(fnusb_ctx *ctx);
int fnusb_process_events(fnusb_ctx *ctx);
int fnusb_process_events_timeout(fnusb_ctx *ctx, struct timeval* timeout);
int fnusb_open_subdevices(freenect_device *dev, int index);
int fnusb_close_subdevices(freenect_device *dev);
int fnusb_start_iso(fnusb_dev *dev, fnusb_isoc_stream *strm, fnusb_iso_cb cb, unsigned char endpoint, int xfers, int pkts, int len);
int fnusb_stop_iso(fnusb_dev *dev, fnusb_isoc_stream *strm);
int fnusb_get_max_iso_packet_size(fnusb_dev *dev, unsigned char endpoint, int default_size);
int fnusb_control(fnusb_dev *dev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t *data, uint16_t wLength);
int fnusb_bulk(fnusb_dev *dev, uint8_t endpoint, uint8_t *data, int len, int *transferred);
int fnusb_num_interfaces(fnusb_dev *dev);