electron / rebuild

Package to rebuild native Node.js modules against the currently installed Electron version
MIT License
1.01k stars 174 forks source link

fatal error C1083: Cannot open include file: 'sqlcli1.h': No such file or directory (compiling source file ..\src\odbc_result.cpp) #224

Open cloudfound21 opened 6 years ago

cloudfound21 commented 6 years ago

I was able to compile and install ibm_db through 'npm i ibm_db'. but when I run '.\node_modules.bin\electron-rebuild.cmd', I get the following error.

The Include folder is already present at the following location. C:\electron\app1\node_modules\ibm_db\installer\clidriver\include\sqlcli1.h

An unhandled error occurred inside electron-rebuild gyp info it worked if it ends with ok gyp info using node-gyp@3.6.2 gyp info using node@8.9.4 | win32 | x64 gyp info spawn C:\Users\user1.windows-build-tools\python27\python.EXE gyp info spawn args [ 'c:\electron\app1\node_modules\node-gyp\gyp\gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'msvs', gyp info spawn args '-G', gyp info spawn args 'msvs_version=auto', gyp info spawn args '-I', gyp info spawn args 'c:\electron\app1\node_modules\ibm_db\build\config.gypi', gyp info spawn args '-I', gyp info spawn args 'c:\electron\app1\node_modules\node-gyp\addon.gypi', gyp info spawn args '-I', gyp info spawn args 'C:\Users\user1\.electron-gyp\.node-gyp\iojs-1.7.10\common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=C:\Users\user1\.electron-gyp\.node-gyp\iojs-1.7.10', gyp info spawn args '-Dnode_gyp_dir=c:\electron\app1\node_modules\node-gyp', gyp info spawn args '-Dnode_lib_file=C:\Users\user1\.electron-gyp\.node-gyp\iojs-1.7.10\<(target_arch)\iojs.lib', gyp info spawn args '-Dmodule_root_dir=c:\electron\app1\node_modules\ibm_db', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'c:\electron\app1\node_modules\ibm_db\build', gyp info spawn args '-Goutput_dir=.' ] gyp info spawn msbuild gyp info spawn args [ 'build/binding.sln', gyp info spawn args '/clp:Verbosity=minimal', gyp info spawn args '/nologo', gyp info spawn args '/p:Configuration=Release;Platform=x64' ] Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. odbc.cpp odbc_connection.cpp odbc_statement.cpp odbc_result.cpp win_delay_load_hook.cc c:\electron\app1\node_modules\ibm_db\src\odbc.h(27): fatal error C1083: Cannot open include file: 'sqlcli1.h': No such file or directory (compiling source file ..\src\odbc_result.cpp) [c:\electron\app1\node_modules\ibm_db\build\odbc_bindings.vcxproj] c:\electron\app1\node_modules\ibm_db\src\odbc.h(27): fatal error C1083: Cannot open include file: 'sqlcli1.h': No such file or directory (compiling source file ..\src\odbc.cpp) [c:\electron\app1\node_modules\ibm_db\build\odbc_bindings.vcxproj] c:\electron\app1\node_modules\ibm_db\src\odbc.h(27): fatal error C1083: Cannot open include file: 'sqlcli1.h': No such file or directory (compiling source file ..\src\odbc_statement.cpp) [c:\electron\app1\node_modules\ibm_db\build\odbc_bindings.vcxproj] c:\electron\app1\node_modules\ibm_db\src\odbc.h(27): fatal error C1083: Cannot open include file: 'sqlcli1.h': No such file or directory (compiling source file ..\src\odbc_connection.cpp) [c:\electron\app1\node_modules\ibm_db\build\odbc_bindings.vcxproj] gyp ERR! build error gyp ERR! stack Error: msbuild failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (c:\electron\app1\node_modules\node-gyp\lib\build.js:258:23) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Windows_NT 10.0.16299 gyp ERR! command "C:\nodejs\node.exe" "c:\electron\app1\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--target=1.7.10" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" gyp ERR! cwd c:\electron\app1\node_modules\ibm_db gyp ERR! node -v v8.9.4 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok

Failed with exit code: 1

schwiet commented 5 years ago

I am having what appears to be the same issue.

c1xx : fatal error C1083: Cannot open source file: '..\src\serialport_win.cpp': No such file or directory [C:\Users\User\code\project\project\electron\node_modules\serialport\build\serialport.vcxproj]

The file is absolutely there, relative to serialport\build\serialport.vcxproj; it is in serialport\src\serialport_win.cpp

I am at a bit of a loss. I've re-installed the Visual Studios Build Tools several different ways, I always get the same error. Why on Earth can this file not be found?

Here is the binding.gyp

{
  'targets': [{
    'target_name': 'serialport',
    'sources': [
      'src/serialport.cpp'
    ],
    'include_dirs': [
      '<!(node -e "require(\'nan\')")'
    ],
    'conditions': [
      ['OS=="win"',
        {
          'sources': [
            'src/serialport_win.cpp'
          ],
          'msvs_settings': {
            'VCCLCompilerTool': {
              'ExceptionHandling': '2',
              'DisableSpecificWarnings': [ '4530', '4506' ],
            }
          }
        }
      ],
      ['OS=="mac"',
        {
          'sources': [
            'src/serialport_unix.cpp',
            'src/poller.cpp',
            'src/darwin_list.cpp'
          ],
          'xcode_settings': {
            'OTHER_LDFLAGS': [
              '-framework CoreFoundation -framework IOKit'
            ]
          }
        }
      ],
      ['OS=="linux"',
        {
          'sources': [
            'src/serialport_unix.cpp',
            'src/poller.cpp',
            'src/serialport_linux.cpp'
          ]
        }
      ],
      ['OS!="win"',
        {
          'sources': [
            'src/serialport_unix.cpp',
            'src/poller.cpp'
          ]
        }
      ]
    ]
  }],
}

Here is what I believe is the relevant section of serialport\build\serialport.vcxproj

  <ItemGroup>
    <None Include="..\binding.gyp"/>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\src\serialport.cpp"/>
    <ClCompile Include="..\src\serialport_win.cpp"/>
    <ClCompile Include="C:\Users\User\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\node-gyp\src\win_delay_load_hook.cc"/>
  </ItemGroup>

Here is the error in total:

× Rebuild Failed

An unhandled error occurred inside electron-rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  serialport.cpp
  serialport_win.cpp
  win_delay_load_hook.cc
c1xx : fatal error C1083: Cannot open source file: '..\src\serialport_win.cpp': No such file or directory [C:\Users\User\code\project\project\electron\node_modules\serialport\build\serialport.vcxproj]
c1xx : fatal error C1083: Cannot open source file: '..\src\serialport.cpp': No such file or directory [C:\Users\User\code\project\project\electron\node_modules\serialport\build\serialport.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\User\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=2.0.10" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd C:\Users\User\code\project\project\electron\node_modules\serialport
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Failed with exit code: 1

Error: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  serialport.cpp
  serialport_win.cpp
  win_delay_load_hook.cc
c1xx : fatal error C1083: Cannot open source file: '..\src\serialport_win.cpp': No such file or directory [C:\Users\User\code\project\project\electron\node_modules\serialport\build\serialport.vcxproj]
c1xx : fatal error C1083: Cannot open source file: '..\src\serialport.cpp': No such file or directory [C:\Users\User\code\project\project\electron\node_modules\serialport\build\serialport.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\User\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=2.0.10" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd C:\Users\User\code\project\project\electron\node_modules\serialport
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Failed with exit code: 1
    at SafeSubscriber._error (C:\Users\User\AppData\Roaming\npm\node_modules\electron-rebuild\node_modules\spawn-rx\lib\src\index.js:277:84)
    ...

What is going on here? Why does it error out finding the file that is really there?