edi9999 / jsqrcode

[deprecated] Lazarsoft's jsqrcode as a node module, object oriented, and with tests
Apache License 2.0
278 stars 63 forks source link

field ‘timestamp’ has incomplete type error during build. #34

Closed RichAyotte closed 7 years ago

RichAyotte commented 7 years ago

I get the following error during installation.

$ npm install

> v4l2camera@1.0.4 install /home/rich/Projects/tmp/v4l2camera
> node-gyp rebuild

make: Entering directory '/home/rich/Projects/tmp/v4l2camera/build'
  CXX(target) Release/obj.target/v4l2camera/v4l2camera.o
  CC(target) Release/obj.target/v4l2camera/capture.o
In file included from ../capture.h:7:0,
                 from ../capture.c:1:
/usr/include/linux/videodev2.h:2127:20: error: field ‘timestamp’ has incomplete type
  struct timespec   timestamp;
                    ^~~~~~~~~
v4l2camera.target.mk:112: recipe for target 'Release/obj.target/v4l2camera/capture.o' failed
make: *** [Release/obj.target/v4l2camera/capture.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ../node_modules/nan/nan_callbacks.h:83:0,
                 from ../node_modules/nan/nan.h:146,
                 from ../v4l2camera.cc:3:
../node_modules/nan/nan_callbacks_12_inl.h: In instantiation of ‘v8::Local<v8::Function> Nan::FunctionCallbackInfo<T>::Callee() const [with T = v8::Value]’:
../v4l2camera.cc:255:48:   required from here
../node_modules/nan/nan_callbacks_12_inl.h:108:71: warning: ‘v8::Local<v8::Function> v8::FunctionCallbackInfo<T>::Callee() const [with T = v8::Value]’ is deprecated: Use Data() to explicitly pass Callee instead [-Wdeprecated-declarations]
   inline v8::Local<v8::Function> Callee() const { return info_.Callee(); }
                                                                       ^
In file included from /home/rich/.node-gyp/7.5.0/include/node/node.h:42:0,
                 from ../node_modules/nan/nan.h:47,
                 from ../v4l2camera.cc:3:
/home/rich/.node-gyp/7.5.0/include/node/v8.h:8119:17: note: declared here
 Local<Function> FunctionCallbackInfo<T>::Callee() const {
                 ^~~~~~~~~~~~~~~~~~~~~~~

I was able to fix it by adding #include <time.h> to the top of capture.h

#ifndef CAMERA_H
#define CAMERA_H

#include <time.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <linux/videodev2.h>
#ifndef __V4L2_COMMON__
#  define CAMERA_OLD_VIDEODEV2_H
#endif
RichAyotte commented 7 years ago

Sorry about the noise. Wrong project.