OpenZWave / node-openzwave-shared

OpenZWave addon for Node.js (all versions) including management and security functions
Other
199 stars 113 forks source link

Build failing on windows 10 - Build environment issue? #331

Closed RoboPhred closed 4 years ago

RoboPhred commented 5 years ago

Having successfully used openzwave-shared quite some time ago, I started to resuscitate one of my old home automation projects on top of it. Unfortunately, while I could install ozw-shared just fine in the past, I now encounter a significant number of build errors trying to install it locally.

The target system is Windows 10 with Visual Studio 2019 community installed, along with various C and C++ feature sets.

The errors the occur seem to be from all over the place, including Nan, missing bits of OpenZWave, and others I cant really identify. It makes me think the install is pulling down an unsupported version of OZW and choking over the function mismatches.

However, the appveyor windows install seems to be succeeding, which leads me to think its a local environment issue. I tried uninstalling my legacy Visual Studio 2015 and replaced it with the 2019 community edition, but that made no difference to the errors.

Here are a splattering of errors, generated from "npm i -S openzwave-shared". Not all of them, and it skips the possible loss of data warnings that I see the appveyor install also gets.

\src\callbacks.cc(99,1): error C2051:  case expression not constant 

\src\callbacks.cc(459,33): error C2039:  'Type_UserAlerts': is not a member of 'OpenZWave::Notification'

\src\callbacks.cc(459,48): error C2065:  'Type_UserAlerts': undeclared identifier 

\src\callbacks.cc(459,1): error C2051:  case expression not constant 

\src\callbacks.cc(468,1): error C2051:  case expression not constant 

\src\openzwave-values.cc(94,30): error C2039:  'ValueType_BitSet': is not a member of 'OpenZWave::ValueID'

\src\openzwave-values.cc(94,46): error C2065:  'ValueType_BitSet': undeclared identifier 

\src\openzwave-values.cc(94,2): error C2051:  case expression not constant 

\src\openzwave-values.cc(298,5): error C2039:  'GetValueAsBitSet': is not a member of 'OpenZWave::Manager'

\src\openzwave-values.cc(319,5): error C2039:  'SetBitMask': is not a member of 'OpenZWave::Manager'

\src\utils.cc(276,3): error C2661:  'Nan::Set': no overloaded function takes 2 arguments 

I'm at a loss here as to what it could be. Any guidance to tracking this down would be greatly appreciated.

RoboPhred commented 5 years ago

Attempting to build the older version 1.4.8 got slightly closer. The first time around, all files compiled successfully but left me with an error about mismatched library types in what appears to be some old left over data at %appdata%/local/openzwave. However, on deleting that folder, errors started to appear on new attempts to install 1.4.8, namely:

error C1083:  Cannot open include file: 'Manager.h': No such file or directory (compiling source file ..\src\openzwave-config.cc)

Interestingly, trying to install the most recent version now also gives me the same error. Apparently the openzwave copy on appdata/local was having some persistent effect on the build, despite the docs claiming that the library will download and install openzwave automatically.

Is there some extra steps for windows that are not documented? Do I need to install OZW independently of this library?

trankin commented 4 years ago

I believe my merged pull request #364 fixes your issue. I've also got a pending pull request that adds several builds for Travis CI and windows. The Appveyor build also was not catching the build errors I was having.

ekarak commented 4 years ago

closing old issue