Vuzi / raspi-sensors

Deprecated - Nodejs C++ plugin, allowing to easily read data from raspberryPi's sensors.
https://www.npmjs.com/package/raspi-sensors
Apache License 2.0
26 stars 3 forks source link

Compilation error: "error: expected unqualified-id before numeric constant const unsigned CHAR_WIDTH = 1;" #14

Open fspezi opened 4 years ago

fspezi commented 4 years ago

I am trying to use your node package, but npm install returns an error:

Interactive builder for raspi-sensor. For more information feel free to visit https://github.com/Vuzi/raspi-sensor
Do you want to use GPIO sensors with this plugin ? (Y/n) y
i2c needs to be functioning, where is located the i2c bus to use ? (/dev/i2c-1) 
Compile in debug or release mode ? (Release|Debug) Release
Now running node-gyp clean...
Now running node-gyp configure...
Now running node-gyp build...
make: ingresso nella directory "/home/pi/xilium/node-repos/Raspi.node/node_modules/raspi-sensors/build"
  CXX(target) Release/obj.target/raspi-sensors/src/format.o
In file included from /usr/lib/gcc/arm-linux-gnueabihf/8/include-fixed/limits.h:194,
                 from /usr/lib/gcc/arm-linux-gnueabihf/8/include-fixed/syslimits.h:7,
                 from /usr/lib/gcc/arm-linux-gnueabihf/8/include-fixed/limits.h:34,
                 from /usr/include/c++/8/climits:42,
                 from ../src/format.cc:35:
../src/format.cc: In member function ‘void fmt::internal::BasicArgFormatter<Impl, Char>::visit_char(int)’:
../src/format.cc:467:20: error: expected unqualified-id before numeric constant
     const unsigned CHAR_WIDTH = 1;
                    ^~~~~~~~~~
make: *** [raspi-sensors.target.mk:133: Release/obj.target/raspi-sensors/src/format.o] Error 1
make: uscita dalla directory "/home/pi/xilium/node-repos/Raspi.node/node_modules/raspi-sensors/build"
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.19.75-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "raspi-sensors" "--release"
gyp ERR! cwd /home/pi/xilium/node-repos/Raspi.node/node_modules/raspi-sensors
gyp ERR! node -v v12.13.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 

Maybe the line would be const unsigned char CHAR_WIDTH = 1; ?

thanks